Class: Neo4j::Core::Query
- Inherits:
-
Object
- Object
- Neo4j::Core::Query
- Defined in:
- lib/rom/neo4j/support/core_ext.rb
Overview
DSL for generating Cypher queries and enumerating their results.
Instance Attribute Summary collapse
-
#session ⇒ Neo4j::Session
readonly
Exports the underlying session handle.
Instance Method Summary collapse
Instance Attribute Details
#session ⇒ Neo4j::Session (readonly)
Exports the underlying session handle.
12 13 14 |
# File 'lib/rom/neo4j/support/core_ext.rb', line 12 def session @session end |
Instance Method Details
#each ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rom/neo4j/support/core_ext.rb', line 14 def each return enum_for(:each) unless block_given? response = self.response columns = response.columns.map { |c| c.to_sym } if response.is_a?(Neo4j::Server::CypherResponse) response.data.map do |row| yield Hash[columns.zip(row)] end else raise Neo4j::Core::UnsupportedDriver, 'Neo4j::Embedded is not supported (yet)' end end |