Class: Origen::Tester::J750::Generator::Patgroups
- Includes:
- Generator
- Defined in:
- lib/origen/tester/j750/generator/patgroups.rb
Constant Summary collapse
- TEMPLATE =
"#{Origen.top}/lib/origen/tester/j750/generator/templates/patgroups.txt.erb"
- OUTPUT_POSTFIX =
'patgroups'
Instance Method Summary collapse
- #add(name, options = {}) ⇒ Object
- #finalize(_options = {}) ⇒ Object
-
#sort! ⇒ Object
Present the patgroups in the final sheet in alphabetical order.
-
#uniq! ⇒ Object
Removes all duplicate patgroups.
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, #on_close, #output_file, #output_inhibited?, #reference_file, #render, #set_flow_description, #stats, #to_be_written?, #write_from_template, #write_to_file
Instance Method Details
#add(name, options = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/origen/tester/j750/generator/patgroups.rb', line 11 def add(name, = {}) p = Patgroup.new(name, ) collection << p p end |
#finalize(_options = {}) ⇒ Object
17 18 19 20 |
# File 'lib/origen/tester/j750/generator/patgroups.rb', line 17 def finalize( = {}) uniq! sort! end |
#sort! ⇒ Object
Present the patgroups in the final sheet in alphabetical order
23 24 25 |
# File 'lib/origen/tester/j750/generator/patgroups.rb', line 23 def sort! collection.sort_by!(&:name) end |
#uniq! ⇒ Object
Removes all duplicate patgroups
28 29 30 31 32 33 34 35 36 |
# File 'lib/origen/tester/j750/generator/patgroups.rb', line 28 def uniq! uniques = [] collection.each do |patgroup| unless uniques.any? { |p| p == patgroup } uniques << patgroup end end self.collection = uniques end |