Skip to content

Instantly share code, notes, and snippets.

@willmurphyscode
Created August 9, 2017 11:37
Embed
What would you like to do?
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