Skip to content

Instantly share code, notes, and snippets.

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
You can’t perform that action at this time.