Class: Neo4j::Core::Relationship

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Wrappable

included

Constructor Details

#initialize(id, type, properties) ⇒ Relationship

Returns a new instance of Relationship.



8
9
10
11
12
# File 'lib/neo4j/core/relationship.rb', line 8

def initialize(id, type, properties)
  @id = id
  @type = type.to_sym unless type.nil?
  @properties = properties
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/neo4j/core/relationship.rb', line 4

def id
  @id
end

#propertiesObject (readonly)

Returns the value of attribute properties.



4
5
6
# File 'lib/neo4j/core/relationship.rb', line 4

def properties
  @properties
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/neo4j/core/relationship.rb', line 4

def type
  @type
end

Class Method Details

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



15
16
17
18
19
20
21
# File 'lib/neo4j/core/relationship.rb', line 15

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

  new(id, type, properties)
end