Make repositories enumerable
This commit is contained in:
parent
47a013eb66
commit
a0ab3cc6da
@ -1,5 +1,7 @@
|
||||
module PlanetExpress
|
||||
class Repository
|
||||
include Enumerable
|
||||
|
||||
attr_reader :data
|
||||
|
||||
def initialize(data:)
|
||||
@ -10,6 +12,12 @@ module PlanetExpress
|
||||
data
|
||||
end
|
||||
|
||||
def each
|
||||
data.each do |item|
|
||||
yield item
|
||||
end
|
||||
end
|
||||
|
||||
def add(item)
|
||||
data.push(item)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user