Class: OrigenTesters::IGXLBasedTester::Base::Patgroups

Inherits:
Object
  • Object
show all
Includes:
Generator
Defined in:
lib/origen_testers/igxl_based_tester/base/patgroups.rb

Direct Known Subclasses

J750::Patgroups, UltraFLEX::Patgroups

Constant Summary collapse

OUTPUT_POSTFIX =
'patgroups'

Instance Attribute Summary

Attributes included from Generator

#output_directory

Instance Method Summary collapse

Methods included from Generator

#close, #collection, #collection=, #compiler, #current_dir, #dont_diff=, execute_source, #file_extension, #file_pipeline, #filename, #filename=, #identity_map, #import, #inhibit_output, #name, #on_close, original_reference_file, original_reference_file=, #output_file, #output_inhibited?, #platform, #reference_file, #render, #set_flow_description, #stats, #to_be_written?, #write_from_template, #write_to_file

Instance Method Details

#add(name, options = {}) ⇒ Object



9
10
11
12
13
# File 'lib/origen_testers/igxl_based_tester/base/patgroups.rb', line 9

def add(name, options = {})
  p = platform::Patgroup.new(name, options)
  collection << p
  p
end

#finalize(options = {}) ⇒ Object



15
16
17
18
# File 'lib/origen_testers/igxl_based_tester/base/patgroups.rb', line 15

def finalize(options = {})
  uniq!
  sort!
end

#sort!Object

Present the patgroups in the final sheet in alphabetical order



21
22
23
# File 'lib/origen_testers/igxl_based_tester/base/patgroups.rb', line 21

def sort!
  collection.sort_by!(&:name)
end

#uniq!Object

Removes all duplicate patgroups



26
27
28
29
30
31
32
33
34
# File 'lib/origen_testers/igxl_based_tester/base/patgroups.rb', line 26

def uniq!
  uniques = []
  collection.each do |patgroup|
    unless uniques.any? { |p| p == patgroup }
      uniques << patgroup
    end
  end
  self.collection = uniques
end