Class: Houston::Provider
- Inherits:
-
Object
- Object
- Houston::Provider
- Defined in:
- lib/houston/boot/provider.rb
Instance Attribute Summary collapse
-
#authorize_path ⇒ Object
Returns the value of attribute authorize_path.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#name ⇒ Object
Returns the value of attribute name.
-
#site ⇒ Object
Returns the value of attribute site.
-
#token_path ⇒ Object
Returns the value of attribute token_path.
Instance Method Summary collapse
- #authorize_url(params = {}) ⇒ Object
-
#initialize(name) ⇒ Provider
constructor
A new instance of Provider.
- #redeem_access_token(code, params = {}) ⇒ Object
- #refresh_access_token(authorization) ⇒ Object
Constructor Details
#initialize(name) ⇒ Provider
Returns a new instance of Provider.
5 6 7 |
# File 'lib/houston/boot/provider.rb', line 5 def initialize(name) @name = name end |
Instance Attribute Details
#authorize_path ⇒ Object
Returns the value of attribute authorize_path.
3 4 5 |
# File 'lib/houston/boot/provider.rb', line 3 def @authorize_path end |
#client_id ⇒ Object
Returns the value of attribute client_id.
3 4 5 |
# File 'lib/houston/boot/provider.rb', line 3 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
3 4 5 |
# File 'lib/houston/boot/provider.rb', line 3 def client_secret @client_secret end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/houston/boot/provider.rb', line 3 def name @name end |
#site ⇒ Object
Returns the value of attribute site.
3 4 5 |
# File 'lib/houston/boot/provider.rb', line 3 def site @site end |
#token_path ⇒ Object
Returns the value of attribute token_path.
3 4 5 |
# File 'lib/houston/boot/provider.rb', line 3 def token_path @token_path end |
Instance Method Details
#authorize_url(params = {}) ⇒ Object
9 10 11 |
# File 'lib/houston/boot/provider.rb', line 9 def (params={}) client.auth_code. params.merge(redirect_uri: oauth2_callback_url) end |
#redeem_access_token(code, params = {}) ⇒ Object
13 14 15 |
# File 'lib/houston/boot/provider.rb', line 13 def redeem_access_token(code, params={}) client.auth_code.get_token(code, params.merge(redirect_uri: oauth2_callback_url)) end |
#refresh_access_token(authorization) ⇒ Object
17 18 19 |
# File 'lib/houston/boot/provider.rb', line 17 def refresh_access_token() OAuth2::AccessToken.from_hash(client, .attributes).refresh! end |