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.
36 37 38 |
# File 'lib/brine/requester.rb', line 36 def initialize @token_type = 'bearer' end |
Instance Attribute Details
#token ⇒ Object
Returns the value of attribute token.
34 35 36 |
# File 'lib/brine/requester.rb', line 34 def token @token end |
#token_type ⇒ Object
Returns the value of attribute token_type.
34 35 36 |
# File 'lib/brine/requester.rb', line 34 def token_type @token_type end |
Instance Method Details
#fetch_from(id, secret, opts) ⇒ Object
40 41 42 43 |
# File 'lib/brine/requester.rb', line 40 def fetch_from(id, secret, opts) @token = OAuth2::Client.new(id, secret, opts) .client_credentials.get_token.token end |