Skip to content

Instantly share code, notes, and snippets.

@reinh
Created May 20, 2010 06:39
Show Gist options
  • Save reinh/407274 to your computer and use it in GitHub Desktop.
Save reinh/407274 to your computer and use it in GitHub Desktop.
class TaskList
include Enumerable
def initialize
@tasks = []
end
end
class TaskList
def add(task)
@tasks << task
end
def each
@tasks.each{ |task| yield task }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment