Module: Neo4j::Cypher::Context::Variable

Defined in:
lib/neo4j-cypher/context.rb

Instance Method Summary collapse

Instance Method Details

#[](prop_name) ⇒ Object



279
280
281
# File 'lib/neo4j-cypher/context.rb', line 279

def [](prop_name)
  Property.new(clause, prop_name).eval_context
end

#[]=(p, value) ⇒ Object



294
295
296
297
298
# File 'lib/neo4j-cypher/context.rb', line 294

def []=(p, value)
  left = Property.new(clause, p).eval_context
  Operator.new(clause_list, left, value, "=", :set)
  self
end

#delObject



310
311
312
313
# File 'lib/neo4j-cypher/context.rb', line 310

def del
  Delete.new(clause_list, clause)
  self
end

#del_label(*labels) ⇒ Object



305
306
307
308
# File 'lib/neo4j-cypher/context.rb', line 305

def del_label(*labels)
  Label.new(clause_list, clause, labels, :remove)
  self
end

#is_a?(klass) ⇒ Boolean

Can be used instead of [_classname] == klass

Returns:

  • (Boolean)


316
317
318
319
# File 'lib/neo4j-cypher/context.rb', line 316

def is_a?(klass)
  return super if klass.class != Class || !klass.respond_to?(:_load_wrapper)
  self[:_classname] == klass.to_s
end

#neo_idObject

generates a ID cypher fragment.



284
285
286
# File 'lib/neo4j-cypher/context.rb', line 284

def neo_id
  Property.new(clause, 'ID').to_function!
end

#property?(p) ⇒ Boolean

generates a has cypher fragment.

Returns:

  • (Boolean)


289
290
291
292
# File 'lib/neo4j-cypher/context.rb', line 289

def property?(p)
  p = Property.new(clause, p)
  Operator.new(clause_list, p, nil, "has").unary!
end

#set_label(*labels) ⇒ Object



300
301
302
303
# File 'lib/neo4j-cypher/context.rb', line 300

def set_label(*labels)
  Label.new(clause_list, clause, labels, :set)
  self
end

#where(&block) ⇒ Object



269
270
271
272
# File 'lib/neo4j-cypher/context.rb', line 269

def where(&block)
  Where.new(clause_list, self, &block)
  self
end

#where_not(&block) ⇒ Object



274
275
276
277
# File 'lib/neo4j-cypher/context.rb', line 274

def where_not(&block)
  Where.new(clause_list, self, &block).neg!
  self
end