Class: Instruction
- Inherits:
-
Array
- Object
- Array
- Instruction
- Defined in:
- lib/parser/instruction.rb
Overview
Instruction names the array elements 0. The Action to perform 1. The Tag involved 2. The Data associated with the Tag.
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Instance Method Summary collapse
-
#initialize(instruction) ⇒ Instruction
constructor
A new instance of Instruction.
Constructor Details
#initialize(instruction) ⇒ Instruction
Returns a new instance of Instruction.
9 10 11 12 13 |
# File 'lib/parser/instruction.rb', line 9 def initialize(instruction) @action = instruction[0] @tag = instruction[1] @data = instruction[2] end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
7 8 9 |
# File 'lib/parser/instruction.rb', line 7 def action @action end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'lib/parser/instruction.rb', line 7 def data @data end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
7 8 9 |
# File 'lib/parser/instruction.rb', line 7 def tag @tag end |