Module: Tankard::Api::Utils::PageFinders

Includes:
Enumerable, Request::Get
Included in:
Beer, Beers, Search, Style, Styles
Defined in:
lib/tankard/api/utils/page_finders.rb

Overview

Seamless querying of multiple pages of results Allows using any ruby enumerable (EX. map)

Author:

  • Matthew Shafer

Instance Method Summary collapse

Instance Method Details

#each {|hash| ... } ⇒ Object

Loads data from brewerydb and calls supplied block with resulting data

Yield Parameters:

  • hash (Hash)

    containing individual beer information



17
18
19
# File 'lib/tankard/api/utils/page_finders.rb', line 17

def each(&block)
  find_on_single_or_all_pages(http_request_parameters, block)
end