Class: Aspen::Statement

Inherits:
AbstractStatement show all
Defined in:
lib/aspen/statement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(origin:, edge:, target:) ⇒ Statement

Returns a new instance of Statement.

Parameters:



23
24
25
26
27
# File 'lib/aspen/statement.rb', line 23

def initialize(origin: , edge: , target: )
  @origin      = origin
  @edge        = edge
  @target = target
end

Instance Attribute Details

#edgeObject (readonly)

Returns the value of attribute edge.



6
7
8
# File 'lib/aspen/statement.rb', line 6

def edge
  @edge
end

#originObject (readonly)

Returns the value of attribute origin.



6
7
8
# File 'lib/aspen/statement.rb', line 6

def origin
  @origin
end

#targetObject (readonly)

Returns the value of attribute target.



6
7
8
# File 'lib/aspen/statement.rb', line 6

def target
  @target
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/aspen/statement.rb', line 6

def type
  @type
end

Instance Method Details

#nodesObject



29
30
31
# File 'lib/aspen/statement.rb', line 29

def nodes
  [origin, target]
end

#signatureObject



12
13
14
15
16
17
18
# File 'lib/aspen/statement.rb', line 12

def signature
  [
    origin.signature,
    edge.signature,
    target.signature
  ].join()
end

#to_cypherObject



33
34
35
36
37
38
39
# File 'lib/aspen/statement.rb', line 33

def to_cypher
  [
    origin.nickname_node,
    edge.to_cypher,
    target.nickname_node
  ].join('')
end