Skip to content

Instantly share code, notes, and snippets.

@deadprogram
Created November 12, 2012 06:33
Show Gist options
  • Select an option

  • Save deadprogram/4057822 to your computer and use it in GitHub Desktop.

Select an option

Save deadprogram/4057822 to your computer and use it in GitHub Desktop.
class WishList
include Enumerable
attr_accessor :wishes
def initialize
@wishes=[]
end
def each &block
@wishes.each_with_index {|item, index| block.call("#{index}, #{item}")}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment