Module: SwitchUser::Provider

Defined in:
lib/switch_user/provider.rb,
lib/switch_user/provider/base.rb,
lib/switch_user/provider/dummy.rb,
lib/switch_user/provider/devise.rb,
lib/switch_user/provider/session.rb,
lib/switch_user/provider/sorcery.rb,
lib/switch_user/provider/authlogic.rb,
lib/switch_user/provider/clearance.rb,
lib/switch_user/provider/restful_authentication.rb

Defined Under Namespace

Classes: Authlogic, Base, Clearance, Devise, Dummy, RestfulAuthentication, Session, Sorcery

Class Method Summary collapse

Class Method Details

.init(controller) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/switch_user/provider.rb', line 14

def self.init(controller)
  klass_part =
    if SwitchUser.provider.is_a?(Hash)
      SwitchUser.provider[:name]
    else
      SwitchUser.provider
    end

  klass_part = klass_part.to_s.classify

  klass = "SwitchUser::Provider::#{klass_part}".constantize

  klass.new(controller)
end