Class: Grumlin::Edge
- Inherits:
-
Object
- Object
- Grumlin::Edge
- Defined in:
- lib/grumlin/edge.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#inV ⇒ Object
readonly
Returns the value of attribute inV.
-
#inVLabel ⇒ Object
readonly
Returns the value of attribute inVLabel.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#outV ⇒ Object
readonly
Returns the value of attribute outV.
-
#outVLabel ⇒ Object
readonly
Returns the value of attribute outVLabel.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(label:, id:, inVLabel:, outVLabel:, inV:, outV:) ⇒ Edge
constructor
A new instance of Edge.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(label:, id:, inVLabel:, outVLabel:, inV:, outV:) ⇒ Edge
Returns a new instance of Edge.
6 7 8 9 10 11 12 13 |
# File 'lib/grumlin/edge.rb', line 6 def initialize(label:, id:, inVLabel:, outVLabel:, inV:, outV:) @label = label @id = Grumlin::Typing.cast(id) @inVLabel = inVLabel @outVLabel = outVLabel @inV = Grumlin::Typing.cast(inV) @outV = Grumlin::Typing.cast(outV) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/grumlin/edge.rb', line 4 def id @id end |
#inV ⇒ Object (readonly)
Returns the value of attribute inV.
4 5 6 |
# File 'lib/grumlin/edge.rb', line 4 def inV @inV end |
#inVLabel ⇒ Object (readonly)
Returns the value of attribute inVLabel.
4 5 6 |
# File 'lib/grumlin/edge.rb', line 4 def inVLabel @inVLabel end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
4 5 6 |
# File 'lib/grumlin/edge.rb', line 4 def label @label end |
#outV ⇒ Object (readonly)
Returns the value of attribute outV.
4 5 6 |
# File 'lib/grumlin/edge.rb', line 4 def outV @outV end |
#outVLabel ⇒ Object (readonly)
Returns the value of attribute outVLabel.
4 5 6 |
# File 'lib/grumlin/edge.rb', line 4 def outVLabel @outVLabel end |
Instance Method Details
#==(other) ⇒ Object
15 16 17 |
# File 'lib/grumlin/edge.rb', line 15 def ==(other) self.class == other.class && @label == other.label && @id == other.id end |
#inspect ⇒ Object
19 20 21 |
# File 'lib/grumlin/edge.rb', line 19 def inspect "e[#{@id}][#{@outV}-#{@label}->#{@inV}]" end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/grumlin/edge.rb', line 23 def to_s inspect end |