16 lines
213 B
Ruby
16 lines
213 B
Ruby
|
module EnumSpecs
|
||
|
class Numerous
|
||
|
|
||
|
include Enumerable
|
||
|
|
||
|
def initialize(*list)
|
||
|
@list = list.empty? ? [2, 5, 3, 6, 1, 4] : list
|
||
|
end
|
||
|
|
||
|
def each
|
||
|
@list.each { |i| yield i }
|
||
|
end
|
||
|
end
|
||
|
|
||
|
end
|