Class: Origen::Tester::Ultraflex::Parser::PatternSets
- Inherits:
-
Parser::SearchableHash
- Object
- Hash
- Parser::SearchableHash
- Origen::Tester::Ultraflex::Parser::PatternSets
- Defined in:
- lib/origen/tester/ultraflex/parser/pattern_sets.rb
Instance Attribute Summary collapse
-
#parser ⇒ Object
Returns the value of attribute parser.
Instance Method Summary collapse
- #import(file) ⇒ Object
-
#initialize(options = {}) ⇒ PatternSets
constructor
A new instance of PatternSets.
- #inspect ⇒ Object
Methods inherited from Parser::SearchableHash
Methods inherited from Hash
#filter, #ids, #intersect?, #intersections, #longest_key, #longest_value, #update_common
Constructor Details
#initialize(options = {}) ⇒ PatternSets
Returns a new instance of PatternSets.
8 9 10 |
# File 'lib/origen/tester/ultraflex/parser/pattern_sets.rb', line 8 def initialize( = {}) @parser = [:parser] end |
Instance Attribute Details
#parser ⇒ Object
Returns the value of attribute parser.
6 7 8 |
# File 'lib/origen/tester/ultraflex/parser/pattern_sets.rb', line 6 def parser @parser end |
Instance Method Details
#import(file) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/origen/tester/ultraflex/parser/pattern_sets.rb', line 12 def import(file) File.readlines(file).each do |line| name = PatternSet.extract_name(line) if name if self[name] self[name].add_pattern_line(line) else l = PatternSet.new(line, parser: parser) self[l.name] = l if l.valid? end end end end |
#inspect ⇒ Object
26 27 28 |
# File 'lib/origen/tester/ultraflex/parser/pattern_sets.rb', line 26 def inspect "<Patsets: #{size}>" end |