Class: Neo4j::Core::CypherSession::Responses::Base

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/neo4j/core/cypher_session/responses.rb

Direct Known Subclasses

Bolt, Driver, Embedded, HTTP

Instance Method Summary collapse

Instance Method Details

#eachObject



12
13
14
15
16
# File 'lib/neo4j/core/cypher_session/responses.rb', line 12

def each
  results.each do |result|
    yield result
  end
end

#resultsObject



35
36
37
# File 'lib/neo4j/core/cypher_session/responses.rb', line 35

def results
  fail '#results not implemented!'
end

#wrap_by_level(none_value) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/neo4j/core/cypher_session/responses.rb', line 18

def wrap_by_level(none_value)
  case @wrap_level
  when :none
    if none_value.is_a?(Array)
      none_value.map(&:symbolize_keys)
    else
      none_value.symbolize_keys
    end
  when :core_entity
    yield
  when :proc
    yield.wrap
  else
    fail ArgumentError, "Invalid wrap_level: #{@wrap_level.inspect}"
  end
end