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.



9
10
11
12
# File 'lib/basic101/array_reference.rb', line 9

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

Instance Method Details

#assign(runtime, value) ⇒ Object



18
19
20
# File 'lib/basic101/array_reference.rb', line 18

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

#dimension_array(runtime) ⇒ Object



22
23
24
# File 'lib/basic101/array_reference.rb', line 22

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

#eval(runtime) ⇒ Object



14
15
16
# File 'lib/basic101/array_reference.rb', line 14

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