Ruby - Enumerable and Collection Processing
Identify the error in this Ruby class using Enumerable:
class MyList
include Enumerable
def initialize(items)
@items = items
end
def each
@items.each
end
end
list = MyList.new([1, 2, 3])
p list.select { |x| x > 1 }