1
0

Make repositories enumerable

This commit is contained in:
Tim Kächele 2021-03-07 18:10:38 +01:00
parent 47a013eb66
commit a0ab3cc6da

View File

@ -1,8 +1,10 @@
module PlanetExpress module PlanetExpress
class Repository class Repository
include Enumerable
attr_reader :data attr_reader :data
def initialize(data: ) def initialize(data:)
@data = data @data = data
end end
@ -10,6 +12,12 @@ module PlanetExpress
data data
end end
def each
data.each do |item|
yield item
end
end
def add(item) def add(item)
data.push(item) data.push(item)
end end