Module: Neo4j::Cypher::Context::Variable
- Defined in:
- lib/neo4j-cypher/context.rb
Instance Method Summary collapse
- #[](prop_name) ⇒ Object
- #[]=(p, value) ⇒ Object
- #del ⇒ Object
- #del_label(*labels) ⇒ Object
-
#is_a?(klass) ⇒ Boolean
Can be used instead of [_classname] == klass.
-
#neo_id ⇒ Object
generates a
ID
cypher fragment. -
#property?(p) ⇒ Boolean
generates a
has
cypher fragment. - #set_label(*labels) ⇒ Object
- #where(&block) ⇒ Object
- #where_not(&block) ⇒ Object
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 |
#del ⇒ Object
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
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_id ⇒ Object
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.
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 |