Class: Lapis::Yggdrasil::Messaging::SignoutRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/lapis/yggdrasil/messaging/signout_request.rb

Overview

Request for invalidating sessions without access tokens.

Instance Method Summary collapse

Constructor Details

#initialize(username, password) ⇒ SignoutRequest

Creates a new signout request.

Parameters:

  • username (String)

    Minecraft username or Mojang account email address.

  • password (String)

    Password for the user.



14
15
16
17
# File 'lib/lapis/yggdrasil/messaging/signout_request.rb', line 14

def initialize(username, password)
  @username = username.dup.freeze
  @password = password.dup.freeze
end

Instance Method Details

#endpointString

Path on the server that handles the request.

Returns:

  • (String)

    Path to handler.



21
22
23
# File 'lib/lapis/yggdrasil/messaging/signout_request.rb', line 21

def endpoint
  '/signout'
end

#to_jsonString

Generates a JSON string that can be sent to an authentication server.

Returns:

  • (String)

    JSON string.



27
28
29
30
31
32
# File 'lib/lapis/yggdrasil/messaging/signout_request.rb', line 27

def to_json
  {
      :username => @username,
      :password => @password
  }.to_json
end