Sha256: 8d3dbe102be9405ffbdb50e103c9bb75b2bf8f2423081382109d5f17cf77cfac

Contents?: true

Size: 620 Bytes

Versions: 5

Compression:

Stored size: 620 Bytes

Contents

class Neo4j::Node

  module Wrapper

    # this is a plugin in the neo4j-core so that the Ruby wrapper will be wrapped around the Neo4j::Node objects
    def wrapper
      wrappers = _class_wrappers
      if wrappers.empty?
        self
      else
        found = wrappers.sort.first
        wrapped_node = Neo4j::ActiveNode::Labels._wrapped_labels[found].new
        wrapped_node.init_on_load(self, self.props)
        wrapped_node
      end
    end

    def _class_wrappers
      labels.find_all do |label_name|
        Neo4j::ActiveNode::Labels._wrapped_labels[label_name].class == Class
      end
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
neo4j-3.0.0.alpha.6 lib/neo4j/wrapper.rb
neo4j-3.0.0.alpha.5 lib/neo4j/wrapper.rb
neo4j-3.0.0.alpha.4 lib/neo4j/wrapper.rb
neo4j-3.0.0.alpha.3 lib/neo4j/wrapper.rb
neo4j-3.0.0.alpha.2 lib/neo4j/wrapper.rb