Class: Twb::Graphedges
- Inherits:
-
Object
- Object
- Twb::Graphedges
- Defined in:
- lib/twb/graphedges.rb
Instance Attribute Summary collapse
-
#edges ⇒ Object
Returns the value of attribute edges.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
-
#initialize(root:) ⇒ Graphedges
constructor
A new instance of Graphedges.
- #to_s ⇒ Object
Constructor Details
#initialize(root:) ⇒ Graphedges
Returns a new instance of Graphedges.
25 26 27 28 |
# File 'lib/twb/graphedges.rb', line 25 def initialize (root:) @root = root if root.instance_of? Twb::Graphnode @edges = [] end |
Instance Attribute Details
#edges ⇒ Object
Returns the value of attribute edges.
23 24 25 |
# File 'lib/twb/graphedges.rb', line 23 def edges @edges end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
22 23 24 |
# File 'lib/twb/graphedges.rb', line 22 def root @root end |
Instance Method Details
#to_s ⇒ Object
30 31 32 |
# File 'lib/twb/graphedges.rb', line 30 def to_s "Root:'%s' edges::%s::" % [@root.to_s, @edges.to_s] end |