Class: Neo4j::Core::Node
- Inherits:
-
Object
- Object
- Neo4j::Core::Node
- Includes:
- Wrappable
- Defined in:
- lib/neo4j/core/node.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
(also: #neo_id)
readonly
Returns the value of attribute id.
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
-
#properties ⇒ Object
(also: #props)
readonly
Returns the value of attribute properties.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id, labels, properties = {}) ⇒ Node
constructor
A new instance of Node.
Methods included from Wrappable
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
#id ⇒ Object (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 |
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
6 7 8 |
# File 'lib/neo4j/core/node.rb', line 6 def labels @labels end |
#properties ⇒ Object (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 |