Class: Neo4j::Driver::Types::Node
- Inherits:
-
Object
- Object
- Neo4j::Driver::Types::Node
- Defined in:
- lib/neo4j/driver/types/node.rb
Overview
Represents a Node in the Neo4j graph
Instance Attribute Summary collapse
-
#element_id ⇒ Object
readonly
Returns the value of attribute element_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #[](key) ⇒ Object
-
#initialize(id, labels, properties, element_id = nil) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(id, labels, properties, element_id = nil) ⇒ Node
Returns a new instance of Node.
10 11 12 13 14 15 |
# File 'lib/neo4j/driver/types/node.rb', line 10 def initialize(id, labels, properties, element_id = nil) @id = id @labels = labels @properties = properties @element_id = element_id || id.to_s end |
Instance Attribute Details
#element_id ⇒ Object (readonly)
Returns the value of attribute element_id.
8 9 10 |
# File 'lib/neo4j/driver/types/node.rb', line 8 def element_id @element_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/neo4j/driver/types/node.rb', line 8 def id @id end |
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
8 9 10 |
# File 'lib/neo4j/driver/types/node.rb', line 8 def labels @labels end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
8 9 10 |
# File 'lib/neo4j/driver/types/node.rb', line 8 def properties @properties end |
Instance Method Details
#==(other) ⇒ Object
21 22 23 |
# File 'lib/neo4j/driver/types/node.rb', line 21 def ==(other) other.is_a?(Node) && other.id == @id end |
#[](key) ⇒ Object
17 18 19 |
# File 'lib/neo4j/driver/types/node.rb', line 17 def [](key) @properties[key.to_s] || @properties[key.to_sym] end |