Class: Rjq::AST::ArrayLiteral
Instance Attribute Summary collapse
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
Attributes inherited from Node
Instance Method Summary collapse
- #eval(input, context) ⇒ Object
-
#initialize(expression) ⇒ ArrayLiteral
constructor
A new instance of ArrayLiteral.
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
#expression ⇒ Object (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 |