Module: Challah::Authenticators

Included in:
Challah
Defined in:
lib/challah/authenticators.rb,
lib/challah/authenticators/api_key.rb,
lib/challah/authenticators/password.rb

Defined Under Namespace

Classes: ApiKey, Password

Instance Method Summary collapse

Instance Method Details

#authenticatorsObject

Get the list of all authenticators that have been registered.



19
20
21
# File 'lib/challah/authenticators.rb', line 19

def authenticators
  @authenticators.dup
end

#register_authenticator(name, klass) ⇒ Object

Register a new authenticator.

Usage:

Challah.register_authenticator(:facebook, FacebookAuthenticator)

Each authenticator class should have a class method named match? that takes a user and a number of arguments and returns true or false.



14
15
16
# File 'lib/challah/authenticators.rb', line 14

def register_authenticator(name, klass)
  @authenticators[name] = klass
end