Module: Sorcery::Controller

Defined in:
lib/sorcery.rb,
lib/sorcery/controller.rb,
lib/sorcery/controller/adapters/sinatra.rb,
lib/sorcery/controller/submodules/external.rb,
lib/sorcery/controller/submodules/remember_me.rb,
lib/sorcery/controller/submodules/http_basic_auth.rb,
lib/sorcery/controller/submodules/session_timeout.rb,
lib/sorcery/controller/submodules/activity_logging.rb,
lib/sorcery/controller/submodules/brute_force_protection.rb,
lib/sorcery/controller/submodules/external/protocols/oauth1.rb,
lib/sorcery/controller/submodules/external/protocols/oauth2.rb,
lib/sorcery/controller/submodules/external/providers/github.rb,
lib/sorcery/controller/submodules/external/providers/twitter.rb,
lib/sorcery/controller/submodules/external/providers/facebook.rb

Defined Under Namespace

Modules: Adapters, Config, InstanceMethods, Submodules

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/sorcery/controller.rb', line 3

def self.included(klass)
  klass.class_eval do
    include InstanceMethods
    Config.submodules.each do |mod|
      begin
        include Submodules.const_get(mod.to_s.split("_").map {|p| p.capitalize}.join("")) 
      rescue NameError
        # don't stop on a missing submodule.
      end
    end
  end
  Config.update!
  Config.configure!
end