1
0
Fork 0
mirror of https://github.com/omniauth/omniauth.git synced 2022-11-09 12:31:49 -05:00

simplifies OmniAuth::Strategy.default_options

This commit is contained in:
Rae Bonfanti 2014-10-12 18:31:47 -07:00
parent 5121fde10d
commit 08a3e4c036

View file

@ -21,9 +21,8 @@ module OmniAuth
# Returns an inherited set of default options set at the class-level
# for each strategy.
def default_options
return @default_options if instance_variable_defined?(:@default_options) && @default_options
existing = superclass.respond_to?(:default_options) ? superclass.default_options : {}
@default_options = OmniAuth::Strategy::Options.new(existing)
existing = superclass.default_options if superclass.respond_to?(:default_options)
@default_options ||= OmniAuth::Strategy::Options.new(existing)
end
# This allows for more declarative subclassing of strategies by allowing