Class: OAuth2Params
- Inherits:
-
Object
- Object
- OAuth2Params
- Defined in:
- lib/brine/requester.rb
Overview
Parameter object used to configure OAuth2 middleware Also used to provide basic DSL for configuration
Instance Attribute Summary collapse
-
#token ⇒ Object
Returns the value of attribute token.
-
#token_type ⇒ Object
Returns the value of attribute token_type.
Instance Method Summary collapse
- #fetch_from(id, secret, opts) ⇒ Object
-
#initialize ⇒ OAuth2Params
constructor
A new instance of OAuth2Params.
Constructor Details
#initialize ⇒ OAuth2Params
Returns a new instance of OAuth2Params.
11 12 13 |
# File 'lib/brine/requester.rb', line 11 def initialize @token_type = 'bearer' end |
Instance Attribute Details
#token ⇒ Object
Returns the value of attribute token.
9 10 11 |
# File 'lib/brine/requester.rb', line 9 def token @token end |
#token_type ⇒ Object
Returns the value of attribute token_type.
9 10 11 |
# File 'lib/brine/requester.rb', line 9 def token_type @token_type end |
Instance Method Details
#fetch_from(id, secret, opts) ⇒ Object
15 16 17 18 |
# File 'lib/brine/requester.rb', line 15 def fetch_from(id, secret, opts) @token = OAuth2::Client.new(id, secret, opts) .client_credentials.get_token.token end |