Class: OAuth2Params

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeOAuth2Params

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

#tokenObject

Returns the value of attribute token.



34
35
36
# File 'lib/brine/requester.rb', line 34

def token
  @token
end

#token_typeObject

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