Class: OrigenTesters::IGXLBasedTester::Parser::DCSpec
- Inherits:
-
Object
- Object
- OrigenTesters::IGXLBasedTester::Parser::DCSpec
- Defined in:
- lib/origen_testers/igxl_based_tester/parser/dc_spec.rb
Instance Attribute Summary collapse
-
#categories ⇒ Object
Returns the value of attribute categories.
-
#name ⇒ Object
(also: #symbol)
Returns the value of attribute name.
-
#parser ⇒ Object
Returns the value of attribute parser.
Instance Method Summary collapse
- #add_values(components) ⇒ Object
-
#initialize(name, categories, options = {}) ⇒ DCSpec
constructor
A new instance of DCSpec.
- #lookup(category, selector) ⇒ Object
Constructor Details
#initialize(name, categories, options = {}) ⇒ DCSpec
Returns a new instance of DCSpec.
9 10 11 12 13 14 |
# File 'lib/origen_testers/igxl_based_tester/parser/dc_spec.rb', line 9 def initialize(name, categories, = {}) @parser = [:parser] @name = name @categories = categories @values = {} end |
Instance Attribute Details
#categories ⇒ Object
Returns the value of attribute categories.
6 7 8 |
# File 'lib/origen_testers/igxl_based_tester/parser/dc_spec.rb', line 6 def categories @categories end |
#name ⇒ Object Also known as: symbol
Returns the value of attribute name.
6 7 8 |
# File 'lib/origen_testers/igxl_based_tester/parser/dc_spec.rb', line 6 def name @name end |
#parser ⇒ Object
Returns the value of attribute parser.
5 6 7 |
# File 'lib/origen_testers/igxl_based_tester/parser/dc_spec.rb', line 5 def parser @parser end |
Instance Method Details
#add_values(components) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/origen_testers/igxl_based_tester/parser/dc_spec.rb', line 16 def add_values(components) @categories.each_with_index do |category, i| @values[category] ||= {} @values[category]['Typ'] ||= components[5 + (i * 3) + 0] @values[category]['Min'] ||= components[5 + (i * 3) + 1] @values[category]['Max'] ||= components[5 + (i * 3) + 2] end end |
#lookup(category, selector) ⇒ Object
25 26 27 28 29 |
# File 'lib/origen_testers/igxl_based_tester/parser/dc_spec.rb', line 25 def lookup(category, selector) if v == @values[category] v[selector] end end |