Module: Trestle::Auth::Backends

Extended by:
ActiveSupport::Autoload
Defined in:
lib/trestle/auth/backends.rb,
lib/trestle/auth/backends/base.rb,
lib/trestle/auth/backends/basic.rb,
lib/trestle/auth/backends/devise.rb,
lib/trestle/auth/backends/warden.rb

Defined Under Namespace

Classes: Base, Basic, Devise, Warden

Class Method Summary collapse

Class Method Details

.lookup(backend) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/trestle/auth/backends.rb', line 12

def self.lookup(backend)
  case backend
  when Class
    backend
  else
    registry.fetch(backend) { raise ArgumentError, "Invalid authentication backend: #{backend.inspect}" }
  end
end

.register(name, klass) ⇒ Object



25
26
27
# File 'lib/trestle/auth/backends.rb', line 25

def self.register(name, klass)
  registry[name] = klass
end

.registryObject



21
22
23
# File 'lib/trestle/auth/backends.rb', line 21

def self.registry
  @registry ||= {}
end