Sha256: fd6ade82cc00ac92362dda2bf54277807fc03f279a671c1384eca36b58c97b6c

Contents?: true

Size: 770 Bytes

Versions: 1

Compression:

Stored size: 770 Bytes

Contents

module TheCity

  class TagGroupListReader < 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
      tag_id = options.delete(:tag_id)
      #@class_key = "tag_#{tag_id}_group_list_#{page}"   
      @url_data_path = "/tags/#{tag_id}/groups"
      @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/tag_group_list_reader.rb