class Neo4j::Cypher::Operand

Attributes

obj[R]

Public Class Methods

new(obj) click to toggle source
  # File lib/neo4j-cypher/operator.rb
7 def initialize(obj)
8   @obj = obj.respond_to?(:clause) ? obj.clause : obj
9 end

Public Instance Methods

regexp?() click to toggle source
   # File lib/neo4j-cypher/operator.rb
11 def regexp?
12   @obj.kind_of?(Regexp)
13 end
to_s() click to toggle source
   # File lib/neo4j-cypher/operator.rb
15 def to_s
16   if @obj.is_a?(String)
17     %Q["#{@obj}"]
18   elsif @obj.is_a?(Operator)
19     "(#{@obj.to_s})"
20   elsif @obj.is_a?(MatchStart)
21     "(#{@obj.to_cypher})"
22   elsif @obj.respond_to?(:expr) && @obj.expr
23     @obj.expr
24   elsif @obj.respond_to?(:source)
25     "'#{@obj.source}'"
26   elsif @obj.respond_to?(:return_value)
27     @obj.return_value.to_s
28   else
29     @obj.to_s
30   end
31 end