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-7.0.7 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.6 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.5 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.4 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.3 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.2 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.1 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.0 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.0.rc.2 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.0.rc.1 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.0.alpha.8 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.0.alpha.7 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.0.alpha.6 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.0.alpha.5 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.0.alpha.4 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.0.alpha.3 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.0.alpha.2 lib/neo4j/core/cypher_session/responses.rb
neo4j-core-7.0.0.alpha.1 lib/neo4j/core/cypher_session/responses.rb