Class: Neo4j::Server::CypherResponse::HashEnumeration
- Inherits:
-
Object
- Object
- Neo4j::Server::CypherResponse::HashEnumeration
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/neo4j-server/cypher_response.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(response, query) ⇒ HashEnumeration
constructor
A new instance of HashEnumeration.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(response, query) ⇒ HashEnumeration
Returns a new instance of HashEnumeration.
26 27 28 29 |
# File 'lib/neo4j-server/cypher_response.rb', line 26 def initialize(response, query) @response = response @query = query end |
Instance Method Details
#each(&block) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/neo4j-server/cypher_response.rb', line 39 def each(&block) @response.each_data_row do |row| yield(row.each_with_index.each_with_object(struct.new) do |(value, i), result| result[columns[i].to_sym] = value end) end end |
#inspect ⇒ Object
35 36 37 |
# File 'lib/neo4j-server/cypher_response.rb', line 35 def inspect "Enumerable query: '#{@query}'" end |
#to_s ⇒ Object
31 32 33 |
# File 'lib/neo4j-server/cypher_response.rb', line 31 def to_s @query end |