Class: Basic101::ArrayReference

Inherits:
Reference show all
Defined in:
lib/basic101/array_reference.rb

Instance Method Summary collapse

Methods inherited from Reference

#input

Methods included from Identity

#==

Constructor Details

#initialize(identifier, arguments) ⇒ ArrayReference

Returns a new instance of ArrayReference.



7
8
9
10
# File 'lib/basic101/array_reference.rb', line 7

def initialize(identifier, arguments)
  super(identifier)
  @arguments = arguments
end

Instance Method Details

#assign(runtime, value) ⇒ Object



16
17
18
# File 'lib/basic101/array_reference.rb', line 16

def assign(runtime, value)
  get_array(runtime).set(indices(runtime), value)
end

#dimension_array(runtime) ⇒ Object



20
21
22
# File 'lib/basic101/array_reference.rb', line 20

def dimension_array(runtime)
  get_array(runtime).dimension(indices(runtime))
end

#eval(runtime) ⇒ Object



12
13
14
# File 'lib/basic101/array_reference.rb', line 12

def eval(runtime)
  get_array(runtime).get(indices(runtime))
end