Class: Neo4j::Core::CypherSession::Adaptors::Base::QueryBuilder
- Inherits:
-
Object
- Object
- Neo4j::Core::CypherSession::Adaptors::Base::QueryBuilder
- Defined in:
- lib/neo4j/core/cypher_session/adaptors.rb
Instance Attribute Summary collapse
-
#queries ⇒ Object
readonly
Returns the value of attribute queries.
Instance Method Summary collapse
- #append(*args) ⇒ Object
-
#initialize ⇒ QueryBuilder
constructor
A new instance of QueryBuilder.
- #query ⇒ Object
Constructor Details
#initialize ⇒ QueryBuilder
Returns a new instance of QueryBuilder.
22 23 24 |
# File 'lib/neo4j/core/cypher_session/adaptors.rb', line 22 def initialize @queries = [] end |
Instance Attribute Details
#queries ⇒ Object (readonly)
Returns the value of attribute queries.
20 21 22 |
# File 'lib/neo4j/core/cypher_session/adaptors.rb', line 20 def queries @queries end |
Instance Method Details
#append(*args) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/neo4j/core/cypher_session/adaptors.rb', line 26 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 |