Class: Cyrel::Expression::PropertyAccess
- Defined in:
- lib/cyrel/expression/property_access.rb
Overview
Represents accessing a property on a variable (node or relationship alias). Example: n.name, r.since
Instance Attribute Summary collapse
-
#property_name ⇒ Object
readonly
Returns the value of attribute property_name.
-
#variable ⇒ Object
readonly
Returns the value of attribute variable.
Instance Method Summary collapse
-
#initialize(variable, property_name) ⇒ PropertyAccess
constructor
A new instance of PropertyAccess.
-
#render(_query) ⇒ String
Renders the property access expression.
Methods inherited from Base
#!=, #%, #&, #*, #+, #-, #/, #<, #<=, #==, #=~, #>, #>=, #^, #|
Constructor Details
#initialize(variable, property_name) ⇒ PropertyAccess
Returns a new instance of PropertyAccess.
12 13 14 15 |
# File 'lib/cyrel/expression/property_access.rb', line 12 def initialize(variable, property_name) @variable = variable.to_sym @property_name = property_name.to_sym end |
Instance Attribute Details
#property_name ⇒ Object (readonly)
Returns the value of attribute property_name.
8 9 10 |
# File 'lib/cyrel/expression/property_access.rb', line 8 def property_name @property_name end |
#variable ⇒ Object (readonly)
Returns the value of attribute variable.
8 9 10 |
# File 'lib/cyrel/expression/property_access.rb', line 8 def variable @variable end |
Instance Method Details
#render(_query) ⇒ String
Renders the property access expression.
20 21 22 |
# File 'lib/cyrel/expression/property_access.rb', line 20 def render(_query) "#{@variable}.#{@property_name}" end |