Class: Neo4j::Core::CypherSession::Responses::Driver
- Defined in:
- lib/neo4j/core/cypher_session/responses/driver.rb
Instance Attribute Summary collapse
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Instance Method Summary collapse
-
#initialize(responses, options = {}) ⇒ Driver
constructor
A new instance of Driver.
- #result_from_data(entities_data) ⇒ Object
- #wrap_by_level(none_proc) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(responses, options = {}) ⇒ Driver
Returns a new instance of Driver.
10 11 12 13 14 |
# File 'lib/neo4j/core/cypher_session/responses/driver.rb', line 10 def initialize(responses, = {}) @wrap_level = [:wrap_level] || Neo4j::Core::Config.wrapping_level @results = responses.map(&method(:result_from_data)) end |
Instance Attribute Details
#results ⇒ Object (readonly)
Returns the value of attribute results.
8 9 10 |
# File 'lib/neo4j/core/cypher_session/responses/driver.rb', line 8 def results @results end |
Instance Method Details
#result_from_data(entities_data) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/neo4j/core/cypher_session/responses/driver.rb', line 16 def result_from_data(entities_data) rows = entities_data.map do |entity_data| wrap_value(entity_data.values) end Neo4j::Core::CypherSession::Result.new(entities_data.keys, rows) end |
#wrap_by_level(none_proc) ⇒ Object
24 25 26 |
# File 'lib/neo4j/core/cypher_session/responses/driver.rb', line 24 def wrap_by_level(none_proc) super(@wrap_level == :none ? none_proc.call : nil) end |