module Wanderer

Constants

VERSION

Public Class Methods

walk(receiver, look_up_method) click to toggle source
# File lib/wanderer.rb, line 6
def self.walk(receiver, look_up_method)
  visited = search(receiver, look_up_method)

  g = GraphViz.new( :G, :type => :digraph )

  visited[0...-1].each_with_index do |item, index|
    a = g.add_nodes(item.to_s)
    b = g.add_nodes(visited[index+1].to_s)
    g.add_edges(a, b)
  end

  # Generate output image
  g.output( :png => "chain.png" )
  visited
end