Sha256: 5ad363d91b75c2d5f49ecba55aa34ac48c652a94160045a33ea2f9a39b8445cc

Contents?: true

Size: 1.86 KB

Versions: 5

Compression:

Stored size: 1.86 KB

Contents

module Neo4j
  # A node in the graph with properties and relationships to other entities.
  # Along with relationships, nodes are the core building blocks of the Neo4j data representation model.
  # Node has three major groups of operations: operations that deal with relationships, operations that deal with properties and operations that traverse the node space.
  # The property operations give access to the key-value property pairs.
  # Property keys are always strings. Valid property value types are the primitives (<tt>String</tt>, <tt>Fixnum</tt>, <tt>Float</tt>, <tt>Boolean</tt>), and arrays of those primitives.
  #
  # The Neo4j::Node#new method does not return a new Ruby instance (!). Instead it will call the Neo4j Java API which will return a
  # *org.neo4j.kernel.impl.core.NodeProxy* object. This java object includes the same mixin as this class. The #class method on the java object
  # returns Neo4j::Node in order to make it feel like an ordinary Ruby object.
  #
  class Node
    extend Neo4j::Core::Node::ClassMethods
    extend Neo4j::Core::Wrapper::ClassMethods

    include Neo4j::Core::Property
    include Neo4j::Core::Rels
    include Neo4j::Core::Traversal
    include Neo4j::Core::Equal
    include Neo4j::Core::Node
    include Neo4j::Core::Wrapper
    include Neo4j::Core::Property::Java # for documentation purpose only

    class << self


      # This method is used to extend a Java Neo4j class so that it includes the same mixins as this class.
      def extend_java_class(java_clazz)
        java_clazz.class_eval do
          include Neo4j::Core::Property
          include Neo4j::Core::Rels
          include Neo4j::Core::Traversal
          include Neo4j::Core::Equal
          include Neo4j::Core::Node
          include Neo4j::Core::Wrapper
        end
      end
    end
  end

  Neo4j::Node.extend_java_class(Java::OrgNeo4jKernelImplCore::NodeProxy)

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
neo4j-core-0.0.9-java lib/neo4j/node.rb
neo4j-core-0.0.8-java lib/neo4j/node.rb
neo4j-core-0.0.7-java lib/neo4j/node.rb
neo4j-core-0.0.6-java lib/neo4j/node.rb
neo4j-core-0.0.5-java lib/neo4j/node.rb