| Module | Grape::DSL::Settings |
| In: |
lib/grape/dsl/settings.rb
|
Keeps track of settings (implemented as key-value pairs, grouped by types), in two contexts: top-level settings which apply globally no matter where they‘re defined, and inheritable settings which apply only in the current scope and scopes nested under it.
| inheritable_setting | [W] | |
| top_level_setting | [W] |
@param type [Symbol] @param key [Symbol] @param value [Object] will be stored if the value is currently empty @return either the old value, if it wasn‘t nil, or the given value
Fetch our current inheritable settings, which are inherited by nested scopes but not shared across siblings.
Fork our inheritable settings to a new instance, copied from our parent‘s, but separate so we won‘t modify it. Every call to this method should have an answering call to namespace_end.
Execute the block within a context where our inheritable settings are forked to a new copy (see namespace_start).