class RubyGraphWalker::Edge
Attributes
error_count[RW]
from[RW]
name[RW]
proc[RW]
to[RW]
visited[RW]
weight[RW]
Public Class Methods
new(args = {})
click to toggle source
# File lib/graph.rb, line 32 def initialize(args = {}) [:name, :to, :proc].each { |key| raise "#{key} is not defined for Edge #{args}" unless args[key] } @name = args[:name] @from = args[:from] @to = args[:to] @weight = args[:weight] || 1 @visited = args[:visited] || false @proc = args[:proc] @error_count = 0 end
Public Instance Methods
run()
click to toggle source
# File lib/graph.rb, line 43 def run @proc.call @visited = true end