Class: Neo4j::Cypher::Where

Inherits:
Object
  • Object
show all
Includes:
Clause
Defined in:
lib/neo4j-cypher/where.rb

Constant Summary

Constants included from Clause

Clause::NAME, Clause::ORDER

Instance Attribute Summary

Attributes included from Clause

#clause_list, #clause_type, #eval_context, #expr, #insert_order

Instance Method Summary collapse

Methods included from Clause

#<=>, #alias_name, #as_alias, #as_alias?, #clause_position, #create_clause_args_for, #match_value, #match_value=, #prefix, #referenced!, #referenced?, #return_value, #separator, #to_prop_string, #valid_clause?, #var_name, #var_name=

Constructor Details

#initialize(clause_list, context, where_statement = nil, &block) ⇒ Where

Returns a new instance of Where.



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/neo4j-cypher/where.rb', line 6

def initialize(clause_list, context, where_statement = nil, &block)
  super(clause_list, :where)

  if where_statement
    @where_statement = where_statement
  else
    clause_list.push
    RootClause::EvalContext.new(context).instance_exec(context, &block)
    @where_statement = clause_list.to_cypher
    clause_list.pop
  end

end

Instance Method Details

#neg!Object



20
21
22
# File 'lib/neo4j-cypher/where.rb', line 20

def neg!
  @where_statement = "not(#{@where_statement})"
end

#to_cypherObject



24
25
26
# File 'lib/neo4j-cypher/where.rb', line 24

def to_cypher
  @where_statement
end