Class: OrigenTesters::IGXLBasedTester::Base::Patsubrs
- Inherits:
-
Object
- Object
- OrigenTesters::IGXLBasedTester::Base::Patsubrs
- Includes:
- Generator
- Defined in:
- lib/origen_testers/igxl_based_tester/base/patsubrs.rb
Direct Known Subclasses
Constant Summary collapse
- OUTPUT_POSTFIX =
'patsubrs'
Instance Attribute Summary
Attributes included from Generator
Instance Method Summary collapse
- #add(name, options = {}) ⇒ Object
- #finalize(options = {}) ⇒ Object
-
#sort! ⇒ Object
Present the patsubrs in the final sheet in alphabetical order.
-
#uniq! ⇒ Object
Removes all duplicate patsubrs.
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/patsubrs.rb', line 9 def add(name, = {}) p = Patsubr.new(name, ) collection << p p end |
#finalize(options = {}) ⇒ Object
15 16 17 18 |
# File 'lib/origen_testers/igxl_based_tester/base/patsubrs.rb', line 15 def finalize( = {}) uniq! sort! end |
#sort! ⇒ Object
Present the patsubrs in the final sheet in alphabetical order
21 22 23 |
# File 'lib/origen_testers/igxl_based_tester/base/patsubrs.rb', line 21 def sort! collection.sort_by!(&:name) end |
#uniq! ⇒ Object
Removes all duplicate patsubrs
26 27 28 29 30 31 32 33 34 |
# File 'lib/origen_testers/igxl_based_tester/base/patsubrs.rb', line 26 def uniq! uniques = [] collection.each do |patsubr| unless uniques.any? { |p| p == patsubr } uniques << patsubr end end self.collection = uniques end |