Class: OrigenTesters::Decompiler::Nodes::Node
- Inherits:
-
Object
- Object
- OrigenTesters::Decompiler::Nodes::Node
- Defined in:
- lib/origen_testers/decompiler/nodes.rb
Direct Known Subclasses
CommentBlock, Frontmatter, Pinlist, Vector, IGXLBasedTester::Decompiler::Atp::GlobalLabel, IGXLBasedTester::Decompiler::Atp::Label, IGXLBasedTester::Decompiler::Atp::StartLabel, SmartestBasedTester::Decompiler::Avc::SequencerInstruction
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #execute? ⇒ Boolean
-
#initialize(context:, type:, **nodes) ⇒ Node
constructor
A new instance of Node.
- #platform_nodes ⇒ Object
Constructor Details
#initialize(context:, type:, **nodes) ⇒ Node
Returns a new instance of Node.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/origen_testers/decompiler/nodes.rb', line 18 def initialize(context:, type:, **nodes) @context = context if type @type = type elsif @type.nil? type = self.class.underscore end unless platform_nodes.empty? platform_nodes.each do |n| define_singleton_method(n) do instance_variable_get("@#{n}".to_sym) end end end end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
5 6 7 |
# File 'lib/origen_testers/decompiler/nodes.rb', line 5 def context @context end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/origen_testers/decompiler/nodes.rb', line 6 def type @type end |
Class Method Details
.inherited(subclass) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/origen_testers/decompiler/nodes.rb', line 8 def self.inherited(subclass) if subclass.const_defined?(:PLATFORM_NODES) subclass.const_get(:PLATFORM_NODES).each do |n| subclass.define_instance_method(n) do instance_variable_get(":@#{n}") end end end end |
Instance Method Details
#execute? ⇒ Boolean
35 36 37 |
# File 'lib/origen_testers/decompiler/nodes.rb', line 35 def execute? @execute end |
#platform_nodes ⇒ Object
39 40 41 |
# File 'lib/origen_testers/decompiler/nodes.rb', line 39 def platform_nodes self.class.const_defined?(:PLATFORM_NODES) ? self.class.const_get(:PLATFORM_NODES) : [] end |