Class: Dentaku::AST::Access
- Inherits:
-
Object
- Object
- Dentaku::AST::Access
- Defined in:
- lib/dentaku/ast/access.rb
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
Constructor Details
#initialize(data_structure, index) ⇒ Access
19 20 21 22 |
# File 'lib/dentaku/ast/access.rb', line 19 def initialize(data_structure, index) @structure = data_structure @index = index end |
Class Method Details
.arity ⇒ Object
4 5 6 |
# File 'lib/dentaku/ast/access.rb', line 4 def self.arity 2 end |
.max_param_count ⇒ Object
12 13 14 |
# File 'lib/dentaku/ast/access.rb', line 12 def self.max_param_count arity end |
.min_param_count ⇒ Object
8 9 10 |
# File 'lib/dentaku/ast/access.rb', line 8 def self.min_param_count arity end |
.peek ⇒ Object
16 17 |
# File 'lib/dentaku/ast/access.rb', line 16 def self.peek(*) end |
Instance Method Details
#dependencies(context = {}) ⇒ Object
30 31 32 |
# File 'lib/dentaku/ast/access.rb', line 30 def dependencies(context = {}) @structure.dependencies(context) + @index.dependencies(context) end |
#type ⇒ Object
34 35 36 |
# File 'lib/dentaku/ast/access.rb', line 34 def type nil end |
#value(context = {}) ⇒ Object
24 25 26 27 28 |
# File 'lib/dentaku/ast/access.rb', line 24 def value(context = {}) structure = @structure.value(context) index = @index.value(context) structure[index] end |