Class: AdminData::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/admin_data/authenticator.rb

Instance Method Summary collapse

Constructor Details

#initialize(userid, password) ⇒ Authenticator

Returns a new instance of Authenticator.



5
6
7
8
# File 'lib/admin_data/authenticator.rb', line 5

def initialize(userid, password)
  @userid = userid
  @password = password
end

Instance Method Details

#verify(controller) ⇒ Object



10
11
12
# File 'lib/admin_data/authenticator.rb', line 10

def verify(controller)
  controller.authenticate_or_request_with_http_basic { |_u, _p| (_u == @userid) && (_p == @password) }
end