Sha256: ee1bf7a9e0b58951b261bb4bbc3e41663977f10fe5b847c4e976ebfe6ee2089d

Contents?: true

Size: 905 Bytes

Versions: 38

Compression:

Stored size: 905 Bytes

Contents

require 'neo4j/core/cypher_session/result'

module Neo4j
  module Core
    class CypherSession
      module Responses
        MAP = {}

        class Base
          include Enumerable

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

          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, "Inalid wrap_level: #{@wrap_level.inspect}"
            end
          end

          def results
            fail '#results not implemented!'
          end
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
neo4j-core-8.1.4 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-8.1.3 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-8.1.2 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-8.1.1 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-8.1.0 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-8.0.4 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-8.0.3 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-8.0.2 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-8.0.1 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.2.4 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-8.0.0 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.2.3 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.2.2 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.2.1 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.2.0 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.1.2 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.9 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.1.1 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.1.0 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.8 lib/neo4j/core/cypher_session/responses.rb