Class: HrrRbSsh::Authentication::Method::Password::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/hrr_rb_ssh/authentication/method/password/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(username, password) ⇒ Context

Returns a new instance of Context.



13
14
15
16
17
18
# File 'lib/hrr_rb_ssh/authentication/method/password/context.rb', line 13

def initialize username, password
  @username = username
  @password = password

  @logger = Logger.new self.class.name
end

Instance Attribute Details

#passwordObject (readonly)

Returns the value of attribute password.



11
12
13
# File 'lib/hrr_rb_ssh/authentication/method/password/context.rb', line 11

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



11
12
13
# File 'lib/hrr_rb_ssh/authentication/method/password/context.rb', line 11

def username
  @username
end

Instance Method Details

#verify(username, password) ⇒ Object



20
21
22
23
24
# File 'lib/hrr_rb_ssh/authentication/method/password/context.rb', line 20

def verify username, password
  @logger.info { "verify username and password" }
  @logger.debug { "username is #{username}, @username is #{@username}, and password is #{password}, @password is #{@password}" }
  username == @username and password == @password
end