Class: KStor::LoginRequest

Inherits:
Message
  • Object
show all
Defined in:
lib/kstor/message.rb

Overview

A user authentication request.

Instance Attribute Summary collapse

Attributes inherited from Message

#args, #type

Instance Method Summary collapse

Methods inherited from Message

parse_request, #serialize

Constructor Details

#initialize(login, password, type, args) ⇒ LoginRequest

Returns a new instance of LoginRequest.



62
63
64
65
66
# File 'lib/kstor/message.rb', line 62

def initialize(, password, type, args)
  @login = 
  @password = password
  super(type, args)
end

Instance Attribute Details

#loginObject (readonly)

Returns the value of attribute login.



59
60
61
# File 'lib/kstor/message.rb', line 59

def 
  @login
end

#passwordObject (readonly)

Returns the value of attribute password.



60
61
62
# File 'lib/kstor/message.rb', line 60

def password
  @password
end

Instance Method Details

#inspectObject



68
69
70
71
72
73
74
75
76
# File 'lib/kstor/message.rb', line 68

def inspect
  fmt = [
    '#<KStor::LoginRequest:%<id>x',
    '@login=%<login>s',
    '@password="******"',
    '@args=%<args>s>'
  ].join(' ')
  format(fmt, id: object_id, login: @login.inspect, args: @args.inspect)
end

#to_hObject



78
79
80
# File 'lib/kstor/message.rb', line 78

def to_h
  super.merge('login' => @login, 'password' => @password)
end