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