Class: Neo4j::Cypher::RelVar::EvalContext
- Inherits:
-
Object
- Object
- Neo4j::Cypher::RelVar::EvalContext
- Includes:
- Aggregate, Alias, Context, Returnable, Sortable, Variable
- Defined in:
- lib/neo4j-cypher/rel_var.rb
Instance Attribute Summary
Attributes included from Context
Instance Method Summary collapse
- #[](p) ⇒ Object
-
#as(name) ⇒ Object
TODO DRY.
-
#null ⇒ Object
generates a
is null
cypher fragment. - #rel_type ⇒ Object
- #where(&block) ⇒ Object
- #where_not(&block) ⇒ Object
Methods included from Context
Instance Method Details
#[](p) ⇒ Object
100 101 102 103 104 105 106 |
# File 'lib/neo4j-cypher/rel_var.rb', line 100 def [](p) # TODO clause.referenced! property = super property.clause.match_value = clause.expr property end |
#as(name) ⇒ Object
TODO DRY
108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/neo4j-cypher/rel_var.rb', line 108 def as(name) # TODO DRY super super.tap do if clause.match_value == '?' clause.match_value = "#{clause.var_name}?" elsif clause.match_value.include?(':') || clause.match_value.include?('?') clause.match_value = clause.match_value.sub(/[^:\?]*/, clause.var_name.to_s) else clause.match_value = clause.var_name.to_s end end end |
#null ⇒ Object
generates a is null
cypher fragment.
94 95 96 97 |
# File 'lib/neo4j-cypher/rel_var.rb', line 94 def null clause.referenced! Operator.new(clause_list, self, nil, '', :where, " is null").unary! end |
#rel_type ⇒ Object
74 75 76 |
# File 'lib/neo4j-cypher/rel_var.rb', line 74 def rel_type Property.new(clause, 'type').to_function! end |