In Files

Parent

Included Modules

OmniAuth::Configuration

Attributes

allowed_request_methods[RW]
camelizations[RW]
form_css[RW]
full_host[RW]
logger[RW]
mock_auth[RW]
on_failure[W]
path_prefix[RW]
test_mode[RW]

Public Class Methods

default_logger() click to toggle source
# File lib/omniauth.rb, line 26
def self.default_logger
  logger = Logger.new(STDOUT)
  logger.progname = "omniauth"
  logger
end
defaults() click to toggle source
# File lib/omniauth.rb, line 51
def self.defaults
  @@defaults
end
new() click to toggle source
# File lib/omniauth.rb, line 55
def initialize
  @@defaults.each_pair{|k,v| self.send("#{k}=",v)}
end

Public Instance Methods

add_camelization(name, camelized) click to toggle source

This is a convenience method to be used by strategy authors so that they can add special cases to the camelization utility method that allows OmniAuth::Builder to work.

@param name [String] The underscored name, e.g. `oauth` @param camelized [String] The properly camelized name, e.g. ‘OAuth’

# File lib/omniauth.rb, line 94
def add_camelization(name, camelized)
  self.camelizations[name.to_s] = camelized.to_s
end
add_mock(provider, mock={}) click to toggle source
# File lib/omniauth.rb, line 67
def add_mock(provider, mock={})
  # Stringify keys recursively one level.
  mock.keys.each do |key|
    mock[key.to_s] = mock.delete(key)
  end
  mock.each_pair do |key, val|
    if val.is_a? Hash
      val.keys.each do |subkey|
        val[subkey.to_s] = val.delete(subkey)
      end
    end
  end

  # Merge with the default mock and ensure provider is correct.
  mock = self.mock_auth[:default].dup.merge(mock)
  mock["provider"] = provider.to_s

  # Add it to the mocks.
  self.mock_auth[provider.to_sym] = mock
end
on_failure(&block) click to toggle source
# File lib/omniauth.rb, line 59
def on_failure(&block)
  if block_given?
    @on_failure = block
  else
    @on_failure
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.