Sha256: ccc35afad87adeb75b3229c51064f4f272e3559e444e2e2f86605446f9f8c6e6

Contents?: true

Size: 902 Bytes

Versions: 1

Compression:

Stored size: 902 Bytes

Contents

module TheCity

  class UserProcessAnswerListReader < ApiReader

    # Constructor.
    #
    # @param options A hash of options for requesting data from the server.
    #                :: user_id and process_id are required
    # @param [CacheAdapter] cacher (optional) The cacher to be used to cache data.
    def initialize(options = {}, cacher = nil)
      options[:page] ||= 1
      user_id = options.delete(:user_id)
      process_id = options.delete(:process_id)
      #@class_key = "users_#{user_id}_processes_#{page}"
      @url_data_path = "/users/#{user_id}/processes/#{process_id}/answers"
      @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
      white_list = [:page]
      options.clone.delete_if { |key, value| !white_list.include?(key) }
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
the-city-admin-0.6.0 lib/readers/user_process_answer_list_reader.rb