Method: Example::Driver#authenticate

Defined in:
examples/example.rb

#authenticate(user, password, account) ⇒ Boolean

Return true if the user should be allowed to log in. Depending upon the server’s auth_level, some of these parameters may be nil. A parameter with a nil value is not required for authentication. Here are the parameters that are non-nil for each auth_level:

  • :user (user)

  • :password (user, password)

  • :account (user, password, account)

Parameters:

  • user (String)
  • password (String)
  • account (String)

Returns:

  • (Boolean)


147
148
149
150
151
# File 'examples/example.rb', line 147

def authenticate(user, password, )
  user == @user &&
    (password.nil? || password == @password) &&
    (.nil? ||  == @account)
end