Module: AnyLogin

Extended by:
ActiveSupport::Autoload
Defined in:
lib/any_login.rb,
lib/any_login/engine.rb,
lib/any_login/helpers.rb,
lib/any_login/version.rb,
lib/any_login/collection.rb,
lib/any_login/providers/devise.rb,
lib/any_login/providers/sorcery.rb,
lib/any_login/providers/authlogic.rb,
lib/any_login/providers/clearance.rb,
app/controllers/any_login/application_controller.rb

Defined Under Namespace

Modules: Helpers, Provider Classes: ApplicationController, Collection, Engine

Constant Summary collapse

VERSION =
'1.5.3'
@@enabled =
Rails.env.to_s == 'development'
@@provider =
nil
@@klass_name =
'User'
@@sign_in =
nil
@@collection_method =
:all
@@name_method =
proc { |e| [e.email, e.id] }
@@redirect_path_after_login =
:root_path
@@login_on =
:both
@@position =
:bottom_left
@@login_button_label =
'Login'
@@select_prompt =
"Select #{AnyLogin.klass_name}"
@@auto_show =
false
@@limit =
10
@@previous_limit =
6
@@http_basic_authentication_enabled =
false
@@http_basic_authentication_user_name =
'any_login'
@@http_basic_authentication_password =
'password'
@@verify_access_proc =
proc { |controller| true }

Class Method Summary collapse

Class Method Details

.collectionObject



91
92
93
# File 'lib/any_login.rb', line 91

def self.collection
  Collection.new(collection_raw)
end


99
100
101
102
103
104
105
106
# File 'lib/any_login.rb', line 99

def self.cookie_name
  module_parent_name = if Rails::VERSION::MAJOR >= 6
                         Rails.application.class.module_parent_name
                       else
                         Rails.application.class.parent_name
                       end
  "any_login_previous_#{module_parent_name}".underscore
end

.klassObject



95
96
97
# File 'lib/any_login.rb', line 95

def self.klass
  @@klass = AnyLogin.klass_name.constantize
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (AnyLogin)

    the object that the method was called on



87
88
89
# File 'lib/any_login.rb', line 87

def self.setup
  yield(self)
end