Class: TheCity::CheckinListByPagerNumberReader

Inherits:
ApiReader
  • Object
show all
Defined in:
lib/readers/checkin_list_by_pager_number_reader.rb

Instance Attribute Summary

Attributes inherited from ApiReader

#headers

Instance Method Summary collapse

Methods inherited from ApiReader

#load_feed, #rate_limit, #rate_limit_remaining

Constructor Details

#initialize(pager_number, options = {}, cacher = nil) ⇒ CheckinListByPagerNumberReader

Constructor.

Parameters:

  • pager_number

    The pager number to filter by

  • options (defaults to: {})

    A hash of options for requesting data from the server.

  • cacher (CacheAdapter) (defaults to: nil)

    (optional) The cacher to be used to cache data.



10
11
12
13
14
15
16
17
18
# File 'lib/readers/checkin_list_by_pager_number_reader.rb', line 10

def initialize(pager_number, options = {}, cacher = nil)
  options[:page] ||= 1
  #@class_key = "checkin_list_#{page}"
  @url_data_path = "/checkins/by_pager_number/#{URI.escape(pager_number)}"
  @url_data_params = white_list_options(options)

  # The object to store and load the cache.
  @cacher = cacher unless cacher.nil?
end

Instance Method Details

#white_list_options(options) ⇒ Object



20
21
22
23
# File 'lib/readers/checkin_list_by_pager_number_reader.rb', line 20

def white_list_options(options)
  white_list = [:page, :include_checked_out, :under_checkin_group_id]
  options.clone.delete_if { |key, value| !white_list.include?(key) }
end