Class: Estreet::Property

Inherits:
Node
  • Object
show all
Defined in:
lib/estreet/object_expression.rb

Instance Attribute Summary

Attributes inherited from Node

#source_location

Instance Method Summary collapse

Methods inherited from Node

#as_json, #loc, #type

Constructor Details

#initialize(key, value) ⇒ Property

TODO: getters and setters



15
16
17
18
# File 'lib/estreet/object_expression.rb', line 15

def initialize(key, value)
  @key = Identifier.new(key)
  @value = value.to_expression
end

Instance Method Details

#attributesObject



20
21
22
# File 'lib/estreet/object_expression.rb', line 20

def attributes
  super.merge(kind: "init".freeze, key: @key, value: @value)
end