Class: Bitly::API::OAuthApp

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/bitly/api/oauth_app.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:, client:, response: nil) ⇒ OAuthApp

Returns a new instance of OAuthApp.



19
20
21
22
23
# File 'lib/bitly/api/oauth_app.rb', line 19

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

Class Method Details

.attributesObject



9
10
11
# File 'lib/bitly/api/oauth_app.rb', line 9

def self.attributes
  [:name, :description, :link, :client_id]
end

.fetch(client:, client_id:) ⇒ Object



14
15
16
17
# File 'lib/bitly/api/oauth_app.rb', line 14

def self.fetch(client:, client_id:)
  response = client.request(path: "/apps/#{client_id}")
  new(data: response.body, client: client, response: response)
end