Class: OmniAuth::Builder
- Inherits:
-
Rack::Builder
- Object
- Rack::Builder
- OmniAuth::Builder
- Defined in:
- lib/omniauth/builder.rb
Instance Method Summary collapse
- #before_callback_phase(&block) ⇒ Object
- #before_options_phase(&block) ⇒ Object
- #before_request_phase(&block) ⇒ Object
- #call(env) ⇒ Object
- #configure(&block) ⇒ Object
- #on_failure(&block) ⇒ Object
- #options(options = false) ⇒ Object
- #provider(klass, *args, &block) ⇒ Object
Instance Method Details
#before_callback_phase(&block) ⇒ Object
15 16 17 |
# File 'lib/omniauth/builder.rb', line 15 def before_callback_phase(&block) OmniAuth.config.before_callback_phase = block end |
#before_options_phase(&block) ⇒ Object
7 8 9 |
# File 'lib/omniauth/builder.rb', line 7 def (&block) OmniAuth.config. = block end |
#before_request_phase(&block) ⇒ Object
11 12 13 |
# File 'lib/omniauth/builder.rb', line 11 def before_request_phase(&block) OmniAuth.config.before_request_phase = block end |
#call(env) ⇒ Object
44 45 46 |
# File 'lib/omniauth/builder.rb', line 44 def call(env) to_app.call(env) end |
#configure(&block) ⇒ Object
19 20 21 |
# File 'lib/omniauth/builder.rb', line 19 def configure(&block) OmniAuth.configure(&block) end |
#on_failure(&block) ⇒ Object
3 4 5 |
# File 'lib/omniauth/builder.rb', line 3 def on_failure(&block) OmniAuth.config.on_failure = block end |
#options(options = false) ⇒ Object
23 24 25 26 27 |
# File 'lib/omniauth/builder.rb', line 23 def ( = false) return @options ||= {} if == false @options = end |
#provider(klass, *args, &block) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/omniauth/builder.rb', line 29 def provider(klass, *args, &block) if klass.is_a?(Class) middleware = klass else begin middleware = OmniAuth::Strategies.const_get(OmniAuth::Utils.camelize(klass.to_s).to_s) rescue NameError raise(LoadError.new("Could not find matching strategy for #{klass.inspect}. You may need to install an additional gem (such as omniauth-#{klass}).")) end end args.last.is_a?(Hash) ? args.push(.merge(args.pop)) : args.push() use middleware, *args, &block end |