Class: Dentaku::AST::Array
Class Method Summary collapse
Instance Method Summary collapse
- #dependencies(context = {}) ⇒ Object
-
#initialize(*elements) ⇒ Array
constructor
A new instance of Array.
- #type ⇒ Object
- #value(context = {}) ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(*elements) ⇒ Array
Returns a new instance of Array.
20 21 22 |
# File 'lib/dentaku/ast/array.rb', line 20 def initialize(*elements) @elements = *elements end |
Class Method Details
.arity ⇒ Object
6 7 |
# File 'lib/dentaku/ast/array.rb', line 6 def self.arity end |
.max_param_count ⇒ Object
13 14 15 |
# File 'lib/dentaku/ast/array.rb', line 13 def self.max_param_count Float::INFINITY end |
.min_param_count ⇒ Object
9 10 11 |
# File 'lib/dentaku/ast/array.rb', line 9 def self.min_param_count 0 end |
.peek ⇒ Object
17 18 |
# File 'lib/dentaku/ast/array.rb', line 17 def self.peek(*) end |
Instance Method Details
#dependencies(context = {}) ⇒ Object
28 29 30 |
# File 'lib/dentaku/ast/array.rb', line 28 def dependencies(context = {}) @elements.flat_map { |el| el.dependencies(context) } end |
#type ⇒ Object
32 33 34 |
# File 'lib/dentaku/ast/array.rb', line 32 def type nil end |
#value(context = {}) ⇒ Object
24 25 26 |
# File 'lib/dentaku/ast/array.rb', line 24 def value(context = {}) @elements.map { |el| el.value(context) } end |