Class: Bitly::API::ClickMetric::List
- Defined in:
- lib/bitly/api/click_metric.rb
Instance Attribute Summary collapse
-
#facet ⇒ Object
readonly
Returns the value of attribute facet.
-
#unit ⇒ Object
readonly
Returns the value of attribute unit.
-
#unit_reference ⇒ Object
readonly
Returns the value of attribute unit_reference.
-
#units ⇒ Object
readonly
Returns the value of attribute units.
Attributes inherited from List
Instance Method Summary collapse
-
#initialize(items:, response:, units:, unit_reference:, unit:, facet:) ⇒ List
constructor
A new instance of List.
Methods inherited from List
Constructor Details
#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 |
Instance Attribute Details
#facet ⇒ Object (readonly)
Returns the value of attribute facet.
13 14 15 |
# File 'lib/bitly/api/click_metric.rb', line 13 def facet @facet end |
#unit ⇒ Object (readonly)
Returns the value of attribute unit.
13 14 15 |
# File 'lib/bitly/api/click_metric.rb', line 13 def unit @unit end |
#unit_reference ⇒ Object (readonly)
Returns the value of attribute unit_reference.
13 14 15 |
# File 'lib/bitly/api/click_metric.rb', line 13 def unit_reference @unit_reference end |
#units ⇒ Object (readonly)
Returns the value of attribute units.
13 14 15 |
# File 'lib/bitly/api/click_metric.rb', line 13 def units @units end |