Class: Estreet::ObjectExpression
- Inherits:
-
Expression
- Object
- Node
- Expression
- Estreet::ObjectExpression
- Defined in:
- lib/estreet/object_expression.rb
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(properties) ⇒ ObjectExpression
constructor
A new instance of ObjectExpression.
Methods inherited from Expression
#[], #call, coerce, #property, #to_expression, #to_statement
Methods inherited from Node
Constructor Details
#initialize(properties) ⇒ ObjectExpression
Returns a new instance of ObjectExpression.
3 4 5 6 |
# File 'lib/estreet/object_expression.rb', line 3 def initialize(properties) raise TypeError unless properties.all? {|p| p.is_a? Property } @props = properties end |
Instance Method Details
#attributes ⇒ Object
8 9 10 |
# File 'lib/estreet/object_expression.rb', line 8 def attributes super.merge(properties: @props) end |