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.

Methods

Attributes

inheritable_setting  [W] 
top_level_setting  [W] 

Public Instance methods

@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

@param key [Symbol] @param value [Object] @return (see get_or_set)

Fetch our current inheritable settings, which are inherited by nested scopes but not shared across siblings.

Set the inheritable settings pointer back up by one level.

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.

Stop defining settings for the current route and clear them for the next, within a namespace.

Fetch our top-level settings, which apply to all endpoints in the API.

@param type [Symbol] @param key [Symbol]

@param key [Symbol]

Execute the block within a context where our inheritable settings are forked to a new copy (see namespace_start).

[Validate]