class Neo4j::Cypher::Property
A property is returned from a Variable by using the [] operator.
It has a number of useful method like count
, sum
, avg
, min
, max
, collect
, head
, last
, tail
,
@example
n=node(2, 3, 4); n[:name].collect # same as START n0=node(2,3,4) RETURN collect(n0.property)
Attributes
prop_name[RW]
Public Class Methods
new(var, prop_name = nil)
click to toggle source
Calls superclass method
Neo4j::Cypher::Clause::new
# File lib/neo4j-cypher/property.rb 17 def initialize(var, prop_name = nil) 18 super(var.clause_list, :property, EvalContext) 19 @var = var 20 @prop_name = prop_name 21 end
Public Instance Methods
expr()
click to toggle source
# File lib/neo4j-cypher/property.rb 28 def expr 29 if @function 30 "#{@prop_name}(#{var_name})" 31 else 32 @prop_name ? "#{@var.var_name}.#{@prop_name}" : @var.var_name.to_s 33 end 34 end
match_value()
click to toggle source
# File lib/neo4j-cypher/property.rb 48 def match_value 49 @var.match_value 50 end
return_value()
click to toggle source
# File lib/neo4j-cypher/property.rb 43 def return_value 44 to_cypher 45 end
to_cypher()
click to toggle source
# File lib/neo4j-cypher/property.rb 58 def to_cypher 59 expr 60 end
to_function!(prop_name = nil)
click to toggle source
@private
# File lib/neo4j-cypher/property.rb 37 def to_function!(prop_name = nil) 38 @prop_name = prop_name if prop_name 39 @function = true 40 eval_context 41 end
unary_operator(op, clause_type = :where, post_fix = nil)
click to toggle source
# File lib/neo4j-cypher/property.rb 52 def unary_operator(op, clause_type = :where, post_fix = nil) 53 # TODO DELETE THIS ? 54 Operator.new(clause_list, self, nil, op, clause_type, post_fix).unary! 55 end
var_name()
click to toggle source
TODO check why needed
# File lib/neo4j-cypher/property.rb 24 def var_name 25 @var.var_name 26 end