Class: Aspen::Statement
- Inherits:
-
AbstractStatement
- Object
- AbstractStatement
- Aspen::Statement
- Defined in:
- lib/aspen/statement.rb
Instance Attribute Summary collapse
-
#edge ⇒ Object
readonly
Returns the value of attribute edge.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(origin:, edge:, target:) ⇒ Statement
constructor
A new instance of Statement.
- #nodes ⇒ Object
- #signature ⇒ Object
- #to_cypher ⇒ Object
Constructor Details
#initialize(origin:, edge:, target:) ⇒ Statement
Returns a new instance of Statement.
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
#edge ⇒ Object (readonly)
Returns the value of attribute edge.
6 7 8 |
# File 'lib/aspen/statement.rb', line 6 def edge @edge end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
6 7 8 |
# File 'lib/aspen/statement.rb', line 6 def origin @origin end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
6 7 8 |
# File 'lib/aspen/statement.rb', line 6 def target @target end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/aspen/statement.rb', line 6 def type @type end |
Instance Method Details
#nodes ⇒ Object
29 30 31 |
# File 'lib/aspen/statement.rb', line 29 def nodes [origin, target] end |
#signature ⇒ Object
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_cypher ⇒ Object
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 |