Class: Neo4j::Core::CypherSession::Adaptors::Base::QueryBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/neo4j/core/cypher_session/adaptors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeQueryBuilder

Returns a new instance of QueryBuilder.



76
77
78
# File 'lib/neo4j/core/cypher_session/adaptors.rb', line 76

def initialize
  @queries = []
end

Instance Attribute Details

#queriesObject (readonly)

Returns the value of attribute queries.



74
75
76
# File 'lib/neo4j/core/cypher_session/adaptors.rb', line 74

def queries
  @queries
end

Instance Method Details

#append(*args) ⇒ Object



80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/neo4j/core/cypher_session/adaptors.rb', line 80

def append(*args)
  query = case args.map(&:class)
          when [String], [String, Hash]
            Query.new(args[0], args[1] || {})
          when [::Neo4j::Core::Query]
            args[0]
          else
            fail ArgumentError, "Could not determine query from arguments: #{args.inspect}"
          end

  @queries << query
end

#queryObject



93
94
95
96
97
# File 'lib/neo4j/core/cypher_session/adaptors.rb', line 93

def query
  # `nil` sessions are just a workaround until
  # we phase out `Query` objects containing sessions
  Neo4j::Core::Query.new(session: nil)
end