Class: Neo4j::Core::CypherSession::Responses::Bolt
- Defined in:
- lib/neo4j/core/cypher_session/responses/bolt.rb
Instance Attribute Summary collapse
-
#result_info ⇒ Object
readonly
Returns the value of attribute result_info.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Instance Method Summary collapse
-
#initialize(queries, flush_messages_proc, options = {}) ⇒ Bolt
constructor
A new instance of Bolt.
- #result_from_data(columns, entities_data) ⇒ Object
- #wrap_entity(entity_data) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(queries, flush_messages_proc, options = {}) ⇒ Bolt
Returns a new instance of Bolt.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/neo4j/core/cypher_session/responses/bolt.rb', line 11 def initialize(queries, , = {}) @wrap_level = [:wrap_level] || Neo4j::Core::Config.wrapping_level @results = queries.map do fields, , = () # @result_info = footer_messages[0].args[0] data = .map do || (, :record) .args[0] end result_from_data(fields, data) end end |
Instance Attribute Details
#result_info ⇒ Object (readonly)
Returns the value of attribute result_info.
9 10 11 |
# File 'lib/neo4j/core/cypher_session/responses/bolt.rb', line 9 def result_info @result_info end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
9 10 11 |
# File 'lib/neo4j/core/cypher_session/responses/bolt.rb', line 9 def results @results end |
Instance Method Details
#result_from_data(columns, entities_data) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/neo4j/core/cypher_session/responses/bolt.rb', line 28 def result_from_data(columns, entities_data) rows = entities_data.map do |entity_data| wrap_entity(entity_data) end Result.new(columns, rows) end |
#wrap_entity(entity_data) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/neo4j/core/cypher_session/responses/bolt.rb', line 36 def wrap_entity(entity_data) case entity_data when Array entity_data.map(&method(:wrap_entity)) when PackStream::Structure wrap_structure(entity_data) when Hash entity_data.each_with_object({}) do |(k, v), result| result[k.to_sym] = wrap_entity(v) end else entity_data end end |