Skip to content

Instantly share code, notes, and snippets.

@willmurphyscode
Created August 9, 2017 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willmurphyscode/3c91a50c205bba8ccab3b57b4b567d4b to your computer and use it in GitHub Desktop.
Save willmurphyscode/3c91a50c205bba8ccab3b57b4b567d4b to your computer and use it in GitHub Desktop.
A simple class in Ruby that includes Enumerable
class Menu
include Enumerable
def initialize(items)
@items = items
end
def each
@items.map { |item| yield item }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment