Class: OrigenTesters::IGXLBasedTester::Parser::PatternSet
- Inherits:
-
Object
- Object
- OrigenTesters::IGXLBasedTester::Parser::PatternSet
- Defined in:
- lib/origen_testers/igxl_based_tester/parser/pattern_set.rb
Defined Under Namespace
Classes: Pattern
Class Method Summary collapse
Instance Method Summary collapse
- #add_pattern_line(line) ⇒ Object
-
#initialize(line, options = {}) ⇒ PatternSet
constructor
A new instance of PatternSet.
-
#inspect ⇒ Object
:nodoc:.
- #name ⇒ Object
-
#pattern_names ⇒ Object
Returns an array containing all pattern names contained in this pattern set.
- #patterns ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(line, options = {}) ⇒ PatternSet
Returns a new instance of PatternSet.
51 52 53 54 55 |
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 51 def initialize(line, = {}) @parser = [:parser] p = add_pattern_line(line) @name = p.pattern_set if p.valid? end |
Class Method Details
.extract_name(line) ⇒ Object
69 70 71 |
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 69 def self.extract_name(line) new(line).name end |
Instance Method Details
#add_pattern_line(line) ⇒ Object
73 74 75 76 77 |
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 73 def add_pattern_line(line) p = Pattern.new(line) patterns << Pattern.new(line) if p.valid? p end |
#inspect ⇒ Object
:nodoc:
57 58 59 |
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 57 def inspect # :nodoc: "<PatternSet: #{name}>" end |
#name ⇒ Object
61 62 63 |
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 61 def name @name end |
#pattern_names ⇒ Object
Returns an array containing all pattern names contained in this pattern set
85 86 87 88 |
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 85 def pattern_names # This removes the path and extensions patterns.map { |pat| pat.name.gsub(/.*[\\\/]/, '').gsub(/\..*/, '') } end |
#patterns ⇒ Object
65 66 67 |
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 65 def patterns @patterns ||= [] end |
#valid? ⇒ Boolean
79 80 81 |
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 79 def valid? patterns.all?(&:valid?) end |