Class: OmniAuth::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/omniauth/core.rb

Constant Summary collapse

@@defaults =
{
  :path_prefix => '/auth',
  :on_failure => Proc.new do |env, message_key|
    new_path = "#{OmniAuth.config.path_prefix}/failure?message=#{message_key}"
    [302, {'Location' => "#{new_path}", 'Content-Type'=> 'text/html'}, []]
  end,
  :form_css => Form::DEFAULT_CSS
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



31
32
33
# File 'lib/omniauth/core.rb', line 31

def initialize
  @@defaults.each_pair{|k,v| self.send("#{k}=",v)}
end

Instance Attribute Details

#form_cssObject

Returns the value of attribute form_css.



44
45
46
# File 'lib/omniauth/core.rb', line 44

def form_css
  @form_css
end

#on_failure(&block) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/omniauth/core.rb', line 35

def on_failure(&block)
  if block_given?
    @on_failure = block
  else
    @on_failure
  end
end

#path_prefixObject

Returns the value of attribute path_prefix.



44
45
46
# File 'lib/omniauth/core.rb', line 44

def path_prefix
  @path_prefix
end

Class Method Details

.defaultsObject



27
28
29
# File 'lib/omniauth/core.rb', line 27

def self.defaults
  @@defaults
end