Class: OrigenTesters::IGXLBasedTester::Base::Patgroup
- Inherits:
-
Object
- Object
- OrigenTesters::IGXLBasedTester::Base::Patgroup
- Defined in:
- lib/origen_testers/igxl_based_tester/base/patgroup.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Pattern
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
Instance Method Summary collapse
- #==(other_patgroup) ⇒ Object
-
#initialize(name, attrs = {}) ⇒ Patgroup
constructor
Specify multiple patterns by passing an array of attributes as the 2nd argument:.
-
#lines ⇒ Object
Returns all lines in the pattern set.
- #name ⇒ Object
- #name=(n) ⇒ Object
-
#sorted_pattern_files ⇒ Object
Returns all pattern files in the pattern set in alphabetical order.
-
#to_s ⇒ Object
Returns the fully formatted pattern group for insertion into a patgroups sheet.
Constructor Details
#initialize(name, attrs = {}) ⇒ Patgroup
Specify multiple patterns by passing an array of attributes as the 2nd argument:
Patset.new("mrd1_pgrp", :pattern => "nvm_mrd1.PAT")
Patset.new("mrd1_pgrp", [{:pattern => "nvm_mrd1.PAT"},
{:pattern => "nvm_global_subs.PAT},
])
60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/origen_testers/igxl_based_tester/base/patgroup.rb', line 60 def initialize(name, attrs = {}) attrs = [attrs] unless attrs.is_a? Array attrs.each do |pattrs| if pattrs[:pattern] pat = Pathname.new(pattrs[:pattern].gsub('\\', '/')).basename('.*').to_s Origen.interface.referenced_patterns << pat end lines << Pattern.new(name, pattrs) end self.name = name end |
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
5 6 7 |
# File 'lib/origen_testers/igxl_based_tester/base/patgroup.rb', line 5 def index @index end |
Instance Method Details
#==(other_patgroup) ⇒ Object
72 73 74 75 76 |
# File 'lib/origen_testers/igxl_based_tester/base/patgroup.rb', line 72 def ==(other_patgroup) self.class == other_patgroup.class && name.to_s == other_patgroup.name.to_s && sorted_pattern_files == other_patgroup.sorted_pattern_files end |
#lines ⇒ Object
Returns all lines in the pattern set
89 90 91 |
# File 'lib/origen_testers/igxl_based_tester/base/patgroup.rb', line 89 def lines @lines ||= [] end |
#name ⇒ Object
78 79 80 |
# File 'lib/origen_testers/igxl_based_tester/base/patgroup.rb', line 78 def name @name end |
#name=(n) ⇒ Object
82 83 84 85 86 |
# File 'lib/origen_testers/igxl_based_tester/base/patgroup.rb', line 82 def name=(n) @name = n lines.each { |l| l.group_name = n } n end |
#sorted_pattern_files ⇒ Object
Returns all pattern files in the pattern set in alphabetical order
94 95 96 |
# File 'lib/origen_testers/igxl_based_tester/base/patgroup.rb', line 94 def sorted_pattern_files @lines.map(&:file_name).sort end |
#to_s ⇒ Object
Returns the fully formatted pattern group for insertion into a patgroups sheet
99 100 101 102 103 104 105 |
# File 'lib/origen_testers/igxl_based_tester/base/patgroup.rb', line 99 def to_s l = '' lines.each do |line| l += "#{line}\r\n" end l.chomp end |