Sha256: ded45990132bf69814e85278e4e8da1187f0c31e95024495f5f3f9e9662cf13a

Contents?: true

Size: 576 Bytes

Versions: 11

Compression:

Stored size: 576 Bytes

Contents

module Neo4j
  module Core
    module Wrappable
      extend ActiveSupport::Concern

      def wrap
        self.class.wrap(self)
      end

      class_methods do
        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

11 entries across 11 versions & 2 rubygems

Version Path
activegraph-10.0.0.pre.alpha.11 lib/neo4j/core/wrappable.rb
activegraph-10.0.0.pre.alpha.10 lib/neo4j/core/wrappable.rb
activegraph-10.0.0.pre.alpha.9 lib/neo4j/core/wrappable.rb
activegraph-10.0.0.pre.alpha.8 lib/neo4j/core/wrappable.rb
activegraph-10.0.0.pre.alpha.7 lib/neo4j/core/wrappable.rb
activegraph-10.0.0.pre.alpha.6 lib/neo4j/core/wrappable.rb
neo4j-10.0.0.pre.alpha.5 lib/neo4j/core/wrappable.rb
neo4j-10.0.0.pre.alpha.4 lib/neo4j/core/wrappable.rb
neo4j-10.0.0.pre.alpha.3 lib/neo4j/core/wrappable.rb
neo4j-10.0.0.pre.alpha.2 lib/neo4j/core/wrappable.rb
neo4j-10.0.0.pre.alpha.1 lib/neo4j/core/wrappable.rb