Class: Twb::Graphedges

Inherits:
Object
  • Object
show all
Defined in:
lib/twb/graphedges.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#edgesObject

Returns the value of attribute edges.



23
24
25
# File 'lib/twb/graphedges.rb', line 23

def edges
  @edges
end

#rootObject (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_sObject



30
31
32
# File 'lib/twb/graphedges.rb', line 30

def to_s
  "Root:'%s'  edges::%s::" % [@root.to_s, @edges.to_s]
end