Class: Instruction

Inherits:
Array
  • Object
show all
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

Instance Method Summary collapse

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

#actionObject (readonly)

Returns the value of attribute action.



7
8
9
# File 'lib/parser/instruction.rb', line 7

def action
  @action
end

#dataObject (readonly)

Returns the value of attribute data.



7
8
9
# File 'lib/parser/instruction.rb', line 7

def data
  @data
end

#tagObject (readonly)

Returns the value of attribute tag.



7
8
9
# File 'lib/parser/instruction.rb', line 7

def tag
  @tag
end