Method: Bitly::API::ClickMetric::List#initialize
- Defined in:
- lib/bitly/api/click_metric.rb
#initialize(items:, response:, units:, unit_reference:, unit:, facet:) ⇒ List
Returns a new instance of List.
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/bitly/api/click_metric.rb', line 14 def initialize(items:, response:, units:, unit_reference:, unit:, facet:) super(items: items, response: response) @units = units # It looks like the API for referrers_by_domain returns the # unit_reference in seconds, not a string, like every other endpoint. begin @unit_reference = Time.parse(unit_reference) if unit_reference rescue TypeError @unit_reference = Time.at(unit_reference) end @unit = unit @facet = facet end |