Class: Bitly::API::Qrcode::ScansSummary

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/bitly/api/qrcode/scans_summary.rb

Instance Attribute Summary

Attributes included from Base

#response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Base

#assign_attributes

Constructor Details

#initialize(data:, response: nil) ⇒ ScansSummary

Returns a new instance of ScansSummary.



27
28
29
30
# File 'lib/bitly/api/qrcode/scans_summary.rb', line 27

def initialize(data:, response: nil)
  assign_attributes(data)
  @response = response
end

Class Method Details

.attributesObject



22
23
24
# File 'lib/bitly/api/qrcode/scans_summary.rb', line 22

def self.attributes
  [:units, :unit, :unit_reference, :total_scans]
end

.fetch(client:, qrcode_id:, unit: nil, units: nil, unit_reference: nil) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/bitly/api/qrcode/scans_summary.rb', line 10

def self.fetch(client:, qrcode_id:, unit: nil, units: nil, unit_reference: nil)
  response = client.request(
    path: "/qr-codes/#{qrcode_id}/scans/summary",
    params: {
      "unit" => unit,
      "units" => units,
      "unit_reference" => unit_reference
    }
  )
  new(data: response.body, response: response)
end