Class: MekariSso::Refresh
- Inherits:
-
HttpRequest
- Object
- HttpRequest
- MekariSso::Refresh
- Defined in:
- lib/requests/refresh.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(config, refresh_token) ⇒ Refresh
constructor
A new instance of Refresh.
- #params ⇒ Object
- #send ⇒ Object
Methods inherited from HttpRequest
#after_error, #after_success, #handle_error, #handle_response, #headers, #original_response
Constructor Details
#initialize(config, refresh_token) ⇒ Refresh
Returns a new instance of Refresh.
11 12 13 14 |
# File 'lib/requests/refresh.rb', line 11 def initialize(config, refresh_token) @config = config @refresh_token = refresh_token end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
9 10 11 |
# File 'lib/requests/refresh.rb', line 9 def code @code end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
9 10 11 |
# File 'lib/requests/refresh.rb', line 9 def config @config end |
Instance Method Details
#params ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/requests/refresh.rb', line 16 def params { client_id: @config.client_id, client_secret: @config.client_secret, grant_type: 'refresh_token', refresh_token: @refresh_token } end |
#send ⇒ Object
25 26 27 |
# File 'lib/requests/refresh.rb', line 25 def send RestClient.post "#{@config.base_url}/auth/oauth2/token", params end |