Module: Neo4j::Core::Cypher::MathFunctions

Included in:
ExprOp, Property, Neo4j::Cypher
Defined in:
lib/neo4j-core/cypher/cypher.rb

Instance Method Summary collapse

Instance Method Details

#_add_math_func(name, value = nil) ⇒ Object



27
28
29
30
31
# File 'lib/neo4j-core/cypher/cypher.rb', line 27

def _add_math_func(name, value=nil)
  value ||= self.respond_to?(:var_name) ? self.var_name : to_s
  expressions.delete(self)
  Property.new(expressions, nil, name).to_function!(value)
end

#abs(value = nil) ⇒ Object



10
11
12
# File 'lib/neo4j-core/cypher/cypher.rb', line 10

def abs(value=nil)
  _add_math_func(:abs, value)
end

#round(value = nil) ⇒ Object



18
19
20
# File 'lib/neo4j-core/cypher/cypher.rb', line 18

def round(value=nil)
  _add_math_func(:round, value)
end

#sign(value = nil) ⇒ Object



22
23
24
# File 'lib/neo4j-core/cypher/cypher.rb', line 22

def sign(value=nil)
  _add_math_func(:sign, value)
end

#sqrt(value = nil) ⇒ Object



14
15
16
# File 'lib/neo4j-core/cypher/cypher.rb', line 14

def sqrt(value=nil)
  _add_math_func(:sqrt, value)
end