Class: Googl::OAuth2::Native

Inherits:
Object
  • Object
show all
Includes:
Utils, Utils
Defined in:
lib/googl/oauth2/native.rb

Constant Summary

Constants included from Utils

Utils::API_CLIENT_LOGIN_URL, Utils::API_HISTORY_URL, Utils::API_URL, Utils::SCOPE_URL

Instance Attribute Summary

Attributes included from Utils

#access_token, #client_id, #client_secret, #expires_at, #expires_in, #items, #refresh_token

Instance Method Summary collapse

Methods included from Utils

#authorized?, #expires?, #history

Constructor Details

#initialize(client_id, client_secret) ⇒ Native

Returns a new instance of Native



9
10
11
12
# File 'lib/googl/oauth2/native.rb', line 9

def initialize(client_id, client_secret)
  self.client_id     = client_id
  self.client_secret = client_secret
end

Instance Method Details

#authorize_urlObject



14
15
16
# File 'lib/googl/oauth2/native.rb', line 14

def authorize_url
  make_authorize_url("urn:ietf:wg:oauth:2.0:oob")
end

#request_access_token(code) ⇒ Object



18
19
20
# File 'lib/googl/oauth2/native.rb', line 18

def request_access_token(code)
  request_token(code)
end