Class: TheCity::UserReader

Inherits:
ApiReader show all
Defined in:
lib/readers/user_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(user_id, options = {}, cacher = nil) ⇒ UserReader

Constructor.

Parameters:

  • user_id

    The ID of the user to load.

  • options (optional) (defaults to: {})

    Options for including more information. ‘include_custom_fields’ => true/false. Default is false.

  • cacher (CacheAdapter) (defaults to: nil)

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



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

def initialize(user_id, options = {}, cacher = nil)
  #@class_key = "users_#{user_id}"   
  @url_data_path = "/users/#{user_id}"
  @url_data_params = options
  
  # The object to store and load the cache.
  @cacher = cacher unless cacher.nil?    
end