Skip to content

Instantly share code, notes, and snippets.

@toretore
Created September 10, 2014 15:21
Embed
What would you like to do?
class Library
attr_accessor :games
def each
games.each do |game|
yield game
end
end
end
library = Library.new(GAMES)
foo = Proc.new { |game| puts "#{game.name} (#{game.system}) - #{game.year}"}
library.each(foo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment