Class: CypherBuilder::Eql

Inherits:
Object
  • Object
show all
Includes:
Resolver
Defined in:
lib/cypher_builder/eql.rb

Instance Method Summary collapse

Methods included from Resolver

#resolve, #wrap

Constructor Details

#initialize(left, right) ⇒ Eql

Returns a new instance of Eql.



9
10
11
# File 'lib/cypher_builder/eql.rb', line 9

def initialize(left, right)
  @left, @right = wrap(left, right)
end

Instance Method Details

#as_cypher(payload:, context:) ⇒ Object



13
14
15
16
17
# File 'lib/cypher_builder/eql.rb', line 13

def as_cypher(payload:, context: )
  sprintf('%s = %s',
          resolve(@left, payload: payload, context: context.add(self)),
          resolve(@right, payload: payload, context: context.add(self)))
end