Sha256: 1e744c4f4b16264d58a7daabd30bc9618b1d76c0385476b9bab7737fe93c4e09
Contents?: true
Size: 864 Bytes
Versions: 11
Compression:
Stored size: 864 Bytes
Contents
module TheCity class MetricMeasurementListReader < ApiReader # Constructor. # # @param options A hash of options for requesting data from the server. # :: metric_id is required # @param [CacheAdapter] cacher (optional) The cacher to be used to cache data. def initialize(options = {}, cacher = nil) options[:page] ||= 1 metric_id = options.delete(:metric_id) #@class_key = "metric_#{metric_id}_measurement_list_#{page}" @url_data_path = "/metrics/#{metric_id}/measurements" @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] options.clone.delete_if { |key, value| !white_list.include?(key) } end end end
Version data entries
11 entries across 11 versions & 1 rubygems