# class Devise::OmniAuth::Config

### Attributes

args[R]
options[R]
provider[R]
strategy[RW]
strategy_name[R]

### Public Class Methods

new(provider, args) click to toggle source

    # File lib/devise/omniauth/config.rb, line 15
    def initialize(provider, args)
      @provider       = provider
      @args           = args
      @options        = @args.last.is_a?(Hash) ? @args.last : {}
      @strategy       = nil
      @strategy_name  = options[:name] || @provider
      @strategy_class = options.delete(:strategy_class)
    end

### Public Instance Methods

autoload_strategy() click to toggle source

    # File lib/devise/omniauth/config.rb, line 35
    def autoload_strategy
      name = ::OmniAuth::Utils.camelize(provider.to_s)
      if ::OmniAuth::Strategies.const_defined?(name)
        ::OmniAuth::Strategies.const_get(name)
      else
        raise StrategyNotFound, name
      end
    end

find_strategy() click to toggle source

    # File lib/devise/omniauth/config.rb, line 28
    def find_strategy
      ::OmniAuth.strategies.find do |strategy_class|
        strategy_class.to_s =~ %r#{::OmniAuth::Utils.camelize(strategy_name)}$/ ||
          strategy_class.default_options[:name] == strategy_name
      end
    end

strategy_class() click to toggle source

    # File lib/devise/omniauth/config.rb, line 24
    def strategy_class
      @strategy_class ||= find_strategy || autoload_strategy
    end