Method: Warden::Config#scope_defaults

Defined in:
lib/warden/config.rb

#scope_defaults(scope, opts = {}) ⇒ Object

A short hand way to set up a particular scope :api: public



74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/warden/config.rb', line 74

def scope_defaults(scope, opts = {})
  if strategies = opts.delete(:strategies)
    default_strategies(strategies, :scope => scope)
  end

  if opts.empty?
    self[:scope_defaults][scope] || {}
  else
    self[:scope_defaults][scope] ||= {}
    self[:scope_defaults][scope].merge!(opts)
  end
end