module SwitchUser::Provider

Public Class Methods

init(controller) click to toggle source
# 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