Class: Estreet::ArrayExpression
- Inherits:
-
Expression
- Object
- Node
- Expression
- Estreet::ArrayExpression
- Defined in:
- lib/estreet/array_expression.rb
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(elements) ⇒ ArrayExpression
constructor
A new instance of ArrayExpression.
Methods inherited from Expression
#[], #call, coerce, #property, #to_expression, #to_statement
Methods inherited from Node
Constructor Details
#initialize(elements) ⇒ ArrayExpression
Returns a new instance of ArrayExpression.
3 4 5 6 7 8 |
# File 'lib/estreet/array_expression.rb', line 3 def initialize(elements) @elements = elements.map do |e| # TODO: is it OK to coerce here? e.nil? ? e : Expression.coerce(e) end end |
Instance Method Details
#attributes ⇒ Object
10 11 12 |
# File 'lib/estreet/array_expression.rb', line 10 def attributes super.merge(elements: @elements) end |