Skip to content

Instantly share code, notes, and snippets.

@toretore
Created September 10, 2014 15:21
Show Gist options
  • Save toretore/4da0804778f1769cad57 to your computer and use it in GitHub Desktop.
Save toretore/4da0804778f1769cad57 to your computer and use it in GitHub Desktop.
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