Module: AnyLogin

Defined in:
lib/any_login.rb,
lib/any_login/engine.rb,
lib/any_login/version.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/helpers/any_login/application_helper.rb,
app/controllers/any_login/application_controller.rb

Defined Under Namespace

Modules: ApplicationHelper, Provider Classes: ApplicationController, Engine

Constant Summary collapse

VERSION =
'1.2.2'
@@enabled =
Rails.env.to_s == 'development'
@@provider =
nil
@@klass_name =
'User'
@@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
@@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



84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/any_login.rb', line 84

def self.collection
  collection_raw.collect do |e|
    if grouped?
      [e[0], e[1].collect(&name_method)]
    else
      if name_method.is_a?(Symbol)
        e.send(name_method)
      else
        name_method.call(e)
      end
    end
  end
end

.grouped?Boolean

Returns:

  • (Boolean)


80
81
82
# File 'lib/any_login.rb', line 80

def self.grouped?
  collection_type == :grouped
end

.klassObject



98
99
100
# File 'lib/any_login.rb', line 98

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



76
77
78
# File 'lib/any_login.rb', line 76

def self.setup
  yield(self)
end