Class: Dentaku::AST::Array

Inherits:
Object
  • Object
show all
Defined in:
lib/dentaku/ast/array.rb

Class Method Summary collapse

Instance Method Summary collapse

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

.arityObject



4
5
# File 'lib/dentaku/ast/array.rb', line 4

def self.arity
end

.max_param_countObject



11
12
13
# File 'lib/dentaku/ast/array.rb', line 11

def self.max_param_count
  Float::INFINITY
end

.min_param_countObject



7
8
9
# File 'lib/dentaku/ast/array.rb', line 7

def self.min_param_count
  0
end

.peekObject



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

#typeObject



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