Class: Whence::WeightedDirectedAcyclicGraph

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/whence.rb

Instance Method Summary collapse

Constructor Details

#initialize(weight) ⇒ WeightedDirectedAcyclicGraph

Returns a new instance of WeightedDirectedAcyclicGraph.



67
68
69
70
# File 'lib/whence.rb', line 67

def initialize(weight)
  __setobj__ nil
  @weight = weight
end

Instance Method Details

#<<(vertex) ⇒ Object



72
73
74
75
76
77
78
# File 'lib/whence.rb', line 72

def <<(vertex)
  if __getobj__
    super
  else
    __setobj__(vertex)
  end
end

#to_sObject



80
81
82
# File 'lib/whence.rb', line 80

def to_s
  __getobj__.to_s(@weight)
end