1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00
heartcombo--devise/lib/devise/omniauth/config.rb
2011-05-25 00:15:24 +04:00

24 lines
No EOL
582 B
Ruby

module Devise
module OmniAuth
class Config
attr_accessor :strategy
attr_reader :args
def initialize(provider, args)
@provider = provider
@args = args
@strategy = nil
end
# open_id strategy can have configurable name
def strategy_name
options = @args.last.is_a?(Hash) && @args.last
options && options[:name] ? options[:name] : @provider
end
def strategy_class
::OmniAuth::Strategies.const_get("#{::OmniAuth::Utils.camelize(@provider.to_s)}")
end
end
end
end