Class: Neo4j::Core::Node

Inherits:
Object
  • Object
show all
Includes:
Wrappable
Defined in:
lib/neo4j/core/node.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Wrappable

included

Constructor Details

#initialize(id, labels, properties = {}) ⇒ Node

Returns a new instance of Node.



14
15
16
17
18
# File 'lib/neo4j/core/node.rb', line 14

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

Instance Attribute Details

#idObject (readonly) Also known as: neo_id

Returns the value of attribute id.



6
7
8
# File 'lib/neo4j/core/node.rb', line 6

def id
  @id
end

#labelsObject (readonly)

Returns the value of attribute labels.



6
7
8
# File 'lib/neo4j/core/node.rb', line 6

def labels
  @labels
end

#propertiesObject (readonly) Also known as: props

Returns the value of attribute properties.



6
7
8
# File 'lib/neo4j/core/node.rb', line 6

def properties
  @properties
end

Class Method Details

.from_url(url, properties = {}) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/neo4j/core/node.rb', line 21

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

  new(id, labels, properties)
end