Class: Rjq::AST::ArrayLiteral

Inherits:
Node
  • Object
show all
Defined in:
lib/rjq/ast.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#source_span

Instance Method Summary collapse

Methods inherited from Node

#assign_value, #invalid_path_message, #paths, #take, #with_source_span

Constructor Details

#initialize(expression) ⇒ ArrayLiteral

Returns a new instance of ArrayLiteral.



630
631
632
# File 'lib/rjq/ast.rb', line 630

def initialize(expression)
  @expression = expression
end

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



628
629
630
# File 'lib/rjq/ast.rb', line 628

def expression
  @expression
end

Instance Method Details

#eval(input, context) ⇒ Object



634
635
636
# File 'lib/rjq/ast.rb', line 634

def eval(input, context)
  [@expression ? @expression.eval(input, context) : []]
end