Class: Bitly::API::Bitlink::ClicksSummary
- Inherits:
-
Object
- Object
- Bitly::API::Bitlink::ClicksSummary
- Includes:
- Bitly::API::Base
- Defined in:
- lib/bitly/api/bitlink/clicks_summary.rb
Instance Attribute Summary
Attributes included from Bitly::API::Base
Class Method Summary collapse
- .attributes ⇒ Object
- .fetch(client:, bitlink:, unit: nil, units: nil, unit_reference: nil, size: nil) ⇒ Object
Instance Method Summary collapse
-
#initialize(data:, response: nil) ⇒ ClicksSummary
constructor
A new instance of ClicksSummary.
Methods included from Bitly::API::Base
Constructor Details
#initialize(data:, response: nil) ⇒ ClicksSummary
Returns a new instance of ClicksSummary.
30 31 32 33 |
# File 'lib/bitly/api/bitlink/clicks_summary.rb', line 30 def initialize(data:, response: nil) assign_attributes(data) @response = response end |
Class Method Details
.attributes ⇒ Object
25 26 27 |
# File 'lib/bitly/api/bitlink/clicks_summary.rb', line 25 def self.attributes [:units, :unit, :unit_reference, :total_clicks] end |
.fetch(client:, bitlink:, unit: nil, units: nil, unit_reference: nil, size: nil) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/bitly/api/bitlink/clicks_summary.rb', line 11 def self.fetch(client:, bitlink:, unit: nil, units: nil, unit_reference: nil, size: nil) bitlink = Utils.normalise_bitlink(bitlink: bitlink) response = client.request( path: "/bitlinks/#{bitlink}/clicks/summary", params: { "unit" => unit, "units" => units, "unit_reference" => unit_reference, "size" => size } ) new(data: response.body, response: response) end |