Class: Ralexa::LazyCollection

Inherits:
Result
  • Object
show all
Includes:
Enumerable
Defined in:
lib/ralexa/lazy_collection.rb

Direct Known Subclasses

PaginatingCollection

Instance Method Summary collapse

Methods inherited from Result

#result

Constructor Details

#initialize(client, host, path, parameters, &parser) ⇒ LazyCollection

Returns a new instance of LazyCollection.



8
9
10
# File 'lib/ralexa/lazy_collection.rb', line 8

def initialize(client, host, path, parameters, &parser)
  super(client, host, path, parameters, &parser)
end

Instance Method Details

#eachObject



12
13
14
15
16
# File 'lib/ralexa/lazy_collection.rb', line 12

def each
  parse(fetch(@parameters)).each do |item|
    yield item
  end
end