Class: FTPMVC::Authenticator::Basic

Inherits:
Struct
  • Object
show all
Defined in:
lib/ftpmvc/authenticator/basic.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Basic

Returns a new instance of Basic.



4
5
6
# File 'lib/ftpmvc/authenticator/basic.rb', line 4

def initialize(options={})
  super options[:users]
end

Instance Attribute Details

#usersObject

Returns the value of attribute users

Returns:

  • (Object)

    the current value of users



3
4
5
# File 'lib/ftpmvc/authenticator/basic.rb', line 3

def users
  @users
end

Instance Method Details

#authenticate(username, password) ⇒ Object



8
9
10
# File 'lib/ftpmvc/authenticator/basic.rb', line 8

def authenticate(username, password)
  users[username] == password
end