Class: OAI::Resumable::ResumptionWrapper

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/oai/client/resumable.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ResumptionWrapper

Returns a new instance of ResumptionWrapper.



7
8
9
10
# File 'lib/oai/client/resumable.rb', line 7

def initialize(response)
  @response = response
  @resumption_block = response.resumption_block
end

Instance Method Details

#each(&block) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/oai/client/resumable.rb', line 12

def each(&block)
  yield_from_response &block
  while resumable?
    @response = @resumption_block.call @response
    yield_from_response &block
  end
end