Class: Dentaku::AST::Array
- Inherits:
-
Object
- Object
- Dentaku::AST::Array
- Defined in:
- lib/dentaku/ast/array.rb
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
Constructor Details
#initialize(*elements) ⇒ Array
Returns a new instance of Array.
18 19 20 |
# File 'lib/dentaku/ast/array.rb', line 18 def initialize(*elements) @elements = *elements end |
Class Method Details
.arity ⇒ Object
4 5 |
# File 'lib/dentaku/ast/array.rb', line 4 def self.arity end |
.max_param_count ⇒ Object
11 12 13 |
# File 'lib/dentaku/ast/array.rb', line 11 def self.max_param_count Float::INFINITY end |
.min_param_count ⇒ Object
7 8 9 |
# File 'lib/dentaku/ast/array.rb', line 7 def self.min_param_count 0 end |
.peek ⇒ Object
15 16 |
# File 'lib/dentaku/ast/array.rb', line 15 def self.peek(*) end |
Instance Method Details
#dependencies(context = {}) ⇒ Object
26 27 28 |
# File 'lib/dentaku/ast/array.rb', line 26 def dependencies(context = {}) @elements.flat_map { |el| el.dependencies(context) } end |
#type ⇒ Object
30 31 32 |
# File 'lib/dentaku/ast/array.rb', line 30 def type nil end |
#value(context = {}) ⇒ Object
22 23 24 |
# File 'lib/dentaku/ast/array.rb', line 22 def value(context = {}) @elements.map { |el| el.value(context) } end |