Sha256: 110e056eabf7db25034536f124a7b899737ef23100cd6aea6350f391d5d3cafa

Contents?: true

Size: 705 Bytes

Versions: 59

Compression:

Stored size: 705 Bytes

Contents

module Neo4j
  module Core
    module Wrappable
      def self.included(base)
        base.send :include, InstanceMethods
        base.extend ClassMethods
      end

      module InstanceMethods
        def wrap
          self.class.wrap(self)
        end
      end

      module ClassMethods
        def wrapper_callback(proc)
          fail 'Callback already specified!' if @wrapper_callback
          @wrapper_callback = proc
        end

        def clear_wrapper_callback
          @wrapper_callback = nil
        end

        def wrap(node)
          if @wrapper_callback
            @wrapper_callback.call(node)
          else
            node
          end
        end
      end
    end
  end
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
neo4j-core-9.0.0 lib/neo4j/core/wrappable.rb
neo4j-core-9.0.0.alpha.1 lib/neo4j/core/wrappable.rb
neo4j-core-8.1.4 lib/neo4j/core/wrappable.rb
neo4j-core-8.1.3 lib/neo4j/core/wrappable.rb
neo4j-core-8.1.2 lib/neo4j/core/wrappable.rb
neo4j-core-8.1.1 lib/neo4j/core/wrappable.rb
neo4j-core-8.1.0 lib/neo4j/core/wrappable.rb
neo4j-core-8.0.4 lib/neo4j/core/wrappable.rb
neo4j-core-8.0.3 lib/neo4j/core/wrappable.rb
neo4j-core-8.0.2 lib/neo4j/core/wrappable.rb
neo4j-core-8.0.1 lib/neo4j/core/wrappable.rb
neo4j-core-7.2.4 lib/neo4j/core/wrappable.rb
neo4j-core-8.0.0 lib/neo4j/core/wrappable.rb
neo4j-core-7.2.3 lib/neo4j/core/wrappable.rb
neo4j-core-7.2.2 lib/neo4j/core/wrappable.rb
neo4j-core-7.2.1 lib/neo4j/core/wrappable.rb
neo4j-core-7.2.0 lib/neo4j/core/wrappable.rb
neo4j-core-7.1.2 lib/neo4j/core/wrappable.rb
neo4j-core-7.0.9 lib/neo4j/core/wrappable.rb
neo4j-core-7.1.1 lib/neo4j/core/wrappable.rb