class Neo4j::Core::CypherSession::Result

Attributes

columns[R]
rows[R]

Public Class Methods

new(columns, rows) click to toggle source
   # File lib/neo4j/core/cypher_session/result.rb
11 def initialize(columns, rows)
12   @columns = columns.map(&:to_sym)
13   @rows = rows
14   @struct_class = Struct.new(:index, *@columns)
15 end

Public Instance Methods

each() { |struct| ... } click to toggle source
   # File lib/neo4j/core/cypher_session/result.rb
19 def each
20   structs.each do |struct|
21     yield struct
22   end
23 end
hashes() click to toggle source
   # File lib/neo4j/core/cypher_session/result.rb
31 def hashes
32   @hashes ||= rows.map do |row|
33     Hash[@columns.zip(row)]
34   end
35 end
structs() click to toggle source
   # File lib/neo4j/core/cypher_session/result.rb
25 def structs
26   @structs ||= rows.each_with_index.map do |row, index|
27     @struct_class.new(index, *row)
28   end
29 end