Method: SettingAccessors::Accessor#get_with_fallback
- Defined in:
- lib/setting_accessors/accessor.rb
#get_with_fallback(key, fallback = nil) ⇒ Object
97 98 99 100 101 102 103 104 105 |
# File 'lib/setting_accessors/accessor.rb', line 97 def get_with_fallback(key, fallback = nil) return self[key] if fallback.nil? case fallback.to_s when 'default' then get_or_default(key) when 'global' then get_or_global(key) else get_or_value(key, fallback) end end |