Class: Lapis::Yggdrasil::Messaging::RefreshRequest
- Inherits:
-
TokenRequest
- Object
- Request
- TokenRequest
- Lapis::Yggdrasil::Messaging::RefreshRequest
- Defined in:
- lib/lapis/yggdrasil/messaging/refresh_request.rb
Overview
Request for renewing a previously used authentication session.
Instance Method Summary collapse
-
#endpoint ⇒ String
Path on the server that handles the request.
-
#initialize(client_token, access_token, profile = nil) ⇒ RefreshRequest
constructor
Creates a new refresh request.
-
#to_json ⇒ String
Generates a JSON string that can be sent to an authentication server.
Constructor Details
#initialize(client_token, access_token, profile = nil) ⇒ RefreshRequest
Creates a new refresh request.
17 18 19 20 |
# File 'lib/lapis/yggdrasil/messaging/refresh_request.rb', line 17 def initialize(client_token, access_token, profile = nil) super(client_token, access_token) @profile = profile end |
Instance Method Details
#endpoint ⇒ String
Path on the server that handles the request.
24 25 26 |
# File 'lib/lapis/yggdrasil/messaging/refresh_request.rb', line 24 def endpoint '/refresh' end |
#to_json ⇒ String
Generates a JSON string that can be sent to an authentication server.
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/lapis/yggdrasil/messaging/refresh_request.rb', line 30 def to_json hash = structure if @profile profile_hash = { :name => @profile.name, :id => @profile.id.to_s(false) } profile_hash[:legacy] = true if @profile.legacy? hash[:selectedProfile] = profile_hash end hash.to_json end |