Class: KazeClient::LoginRequest

Inherits:
Utils::FinalRequest show all
Defined in:
lib/kaze_client/request/requests/login_request.rb

Overview

Authenticate a user on the server.

See Also:

Author:

Since:

  • 0.1.0

Constant Summary

Constants inherited from Request

Request::DEFAULT_HEADERS

Instance Attribute Summary collapse

Attributes inherited from Request

#body, #headers, #method, #query, #url

Instance Method Summary collapse

Methods inherited from Request

#error_for, #parameters

Constructor Details

#initialize(login:, password:) ⇒ LoginRequest

Returns a new instance of LoginRequest.

Parameters:

  • login (String)

    The user login.

  • password (String)

    The user password.

Since:

  • 0.1.0



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/kaze_client/request/requests/login_request.rb', line 17

def initialize(login:, password:)
  super(:post, 'api/login')

  @login    = 
  @password = password
  @body     = {
    user: {
      login:    @login,
      password: @password
    }
  }
end

Instance Attribute Details

#loginString (readonly)

Returns The user login.

Returns:

  • (String)

    The user login.

Since:

  • 0.1.0



13
14
15
# File 'lib/kaze_client/request/requests/login_request.rb', line 13

def 
  @login
end