30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/async/slack/search.rb', line 30
def each(page: 1, count: 100, **parameters)
return to_enum(:each, page: page, count: count, **parameters) unless block_given?
collection = self.collection(**parameters)
while true
representation = collection.get(self.class, page: page, count: count)
records = representation.records
records.each do |value|
yield represent(representation.metadata, value)
end
break if records.size < count
page += 1
end
end
|