Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRubyEnumerable and custom eachSingle-choice MCQ

A class includes Enumerable and defines only `each`. Which of these calls will raise NoMethodError?

class Bag include Enumerable def initialize(*items) = @items = items def each(&blk) = @items.each(&blk) end bag = Bag.new(3, 1, 2)