Need help Implementing DFS in Ruby

For sake of less text :
http://stackoverflow.com/questions/33318826/implementing-dfs-in-ruby