Class: OrigenTesters::IGXLBasedTester::Parser::PatternSet::Pattern
- Inherits:
-
Object
- Object
- OrigenTesters::IGXLBasedTester::Parser::PatternSet::Pattern
- Defined in:
- lib/origen_testers/igxl_based_tester/parser/pattern_set.rb
Constant Summary collapse
- ATTRS =
%w(pattern_set file_name start_label stop_label comment)
- ALIASES =
{ pattern: :file_name, file: :file_name, name: :file_name }
Instance Attribute Summary collapse
-
#parser ⇒ Object
Returns the value of attribute parser.
Instance Method Summary collapse
- #components ⇒ Object
-
#initialize(line) ⇒ Pattern
constructor
A new instance of Pattern.
- #parse ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(line) ⇒ Pattern
Returns a new instance of Pattern.
27 28 29 30 31 32 33 34 35 |
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 27 def initialize(line) @line = line parse if valid? ATTRS.each_with_index do |attr, i| instance_variable_set("@#{attr}", components[i + 1]) end end end |
Instance Attribute Details
#parser ⇒ Object
Returns the value of attribute parser.
6 7 8 |
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 6 def parser @parser end |
Instance Method Details
#components ⇒ Object
46 47 48 |
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 46 def components @components ||= [] end |
#parse ⇒ Object
37 38 39 |
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 37 def parse @components = @line.split("\t") unless @line.strip.empty? end |
#valid? ⇒ Boolean
41 42 43 44 |
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 41 def valid? components[1] && !components[1].empty? && components[1] != 'Pattern Set' && components[2] && !components[2].empty? end |