Class: Dentaku::AST::Access
Class Method Summary collapse
Instance Method Summary collapse
- #dependencies(context = {}) ⇒ Object
-
#initialize(data_structure, index) ⇒ Access
constructor
A new instance of Access.
- #type ⇒ Object
- #value(context = {}) ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(data_structure, index) ⇒ Access
Returns a new instance of Access.
21 22 23 24 |
# File 'lib/dentaku/ast/access.rb', line 21 def initialize(data_structure, index) @structure = data_structure @index = index end |
Class Method Details
.arity ⇒ Object
6 7 8 |
# File 'lib/dentaku/ast/access.rb', line 6 def self.arity 2 end |
.max_param_count ⇒ Object
14 15 16 |
# File 'lib/dentaku/ast/access.rb', line 14 def self.max_param_count arity end |
.min_param_count ⇒ Object
10 11 12 |
# File 'lib/dentaku/ast/access.rb', line 10 def self.min_param_count arity end |
.peek ⇒ Object
18 19 |
# File 'lib/dentaku/ast/access.rb', line 18 def self.peek(*) end |
Instance Method Details
#dependencies(context = {}) ⇒ Object
32 33 34 |
# File 'lib/dentaku/ast/access.rb', line 32 def dependencies(context = {}) @structure.dependencies(context) + @index.dependencies(context) end |
#type ⇒ Object
36 37 38 |
# File 'lib/dentaku/ast/access.rb', line 36 def type nil end |
#value(context = {}) ⇒ Object
26 27 28 29 30 |
# File 'lib/dentaku/ast/access.rb', line 26 def value(context = {}) structure = @structure.value(context) index = @index.value(context) structure[index] end |