Sha256: c2ec41708dc45680839baa678fd4ff693a237616a1720c82b8628ffdc8aefeca

Contents?: true

Size: 867 Bytes

Versions: 6

Compression:

Stored size: 867 Bytes

Contents

module TheCity

  class UserListReader < ApiReader

    # Constructor.
    #
    # @param options A hash of options for requesting data from the server.
    # @param [CacheAdapter] cacher (optional) The cacher to be used to cache data.
    def initialize(options = {}, cacher = nil) 
      options[:page] ||= 1

      #@class_key = "user_list_#{page}_#{filter.to_s.downcase.gsub(' ','')}"   
      @url_data_path = "/users"
      @url_data_params = white_list_options(options)
      
      # The object to store and load the cache.
      @cacher = cacher unless cacher.nil?    
    end

    def white_list_options(options)
      white_list = [:page, :per_page, :filter, :include_participation, :include_custom_fields, :include_barcodes, :include_addresses, :include_family]
      options.clone.delete_if { |key, value| !white_list.include?(key) }
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
the-city-admin-0.7.1 lib/readers/user_list_reader.rb
the-city-admin-0.7.0 lib/readers/user_list_reader.rb
the-city-admin-0.6.9 lib/readers/user_list_reader.rb
the-city-admin-0.6.8 lib/readers/user_list_reader.rb
the-city-admin-0.6.7 lib/readers/user_list_reader.rb
the-city-admin-0.6.6 lib/readers/user_list_reader.rb