Class: BTCJammer::OAuth
Overview
Helper methods around OAuth2
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Class Method Summary collapse
Instance Method Summary collapse
- #authorization_url ⇒ Object
- #get_access_token(code) ⇒ Object
-
#initialize ⇒ OAuth
constructor
A new instance of OAuth.
Constructor Details
#initialize ⇒ OAuth
Returns a new instance of OAuth.
34 35 36 37 |
# File 'lib/btcjammer.rb', line 34 def initialize @client = Client.new(BTCJam.client_id, BTCJam.client_secret, site: API_PUBLIC_URL) end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
33 34 35 |
# File 'lib/btcjammer.rb', line 33 def client @client end |
Class Method Details
Instance Method Details
#authorization_url ⇒ Object
39 40 41 42 |
# File 'lib/btcjammer.rb', line 39 def @client.auth_code.(redirect_uri: BTCJam.redirect_uri, scope: BTCJam.scopes.join(' ')) end |
#get_access_token(code) ⇒ Object
44 45 46 |
# File 'lib/btcjammer.rb', line 44 def get_access_token(code) @client.auth_code.get_token(code, redirect_uri: BTCJam.redirect_uri) end |