Sha256: 937ebca4980289423328ca4955748dbf7cf6510882af616b03f02f1414d4bf7a

Contents?: true

Size: 675 Bytes

Versions: 17

Compression:

Stored size: 675 Bytes

Contents

require 'neo4j/core/wrappable'

module Neo4j
  module Core
    class Node
      attr_reader :id, :labels, :properties
      alias_method :props, :properties

      include Wrappable

      # Perhaps we should deprecate this?
      alias_method :neo_id, :id

      def initialize(id, labels, properties = {})
        @id = id
        @labels = labels.map(&:to_sym) unless labels.nil?
        @properties = properties
      end

      class << self
        def from_url(url, properties = {})
          id = url.split('/')[-1].to_i
          labels = nil # unknown
          properties = properties

          new(id, labels, properties)
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
neo4j-core-6.1.6 lib/neo4j/core/node.rb
neo4j-core-6.1.5 lib/neo4j/core/node.rb
neo4j-core-6.1.4 lib/neo4j/core/node.rb
neo4j-core-6.1.3 lib/neo4j/core/node.rb
neo4j-core-6.1.2 lib/neo4j/core/node.rb
neo4j-core-6.1.1 lib/neo4j/core/node.rb
neo4j-core-6.0.6 lib/neo4j/core/node.rb
neo4j-core-6.0.5 lib/neo4j/core/node.rb
neo4j-core-6.1.0 lib/neo4j/core/node.rb
neo4j-core-6.0.4 lib/neo4j/core/node.rb
neo4j-core-6.0.3 lib/neo4j/core/node.rb
neo4j-core-6.0.2 lib/neo4j/core/node.rb
neo4j-core-6.0.1 lib/neo4j/core/node.rb
neo4j-core-6.0.0 lib/neo4j/core/node.rb
neo4j-core-6.0.0.rc.1 lib/neo4j/core/node.rb
neo4j-core-6.0.0.alpha.6 lib/neo4j/core/node.rb
neo4j-core-6.0.0.alpha.5 lib/neo4j/core/node.rb