lib/grape/dsl/settings.rb in grape-0.14.0 vs lib/grape/dsl/settings.rb in grape-0.15.0
- old
+ new
@@ -69,11 +69,11 @@
get_or_set :namespace, key, value
end
# (see #unset_global_setting)
def unset_namespace_setting(key)
- unset :namespace_setting, key
+ unset :namespace, key
end
# (see #global_setting)
def namespace_inheritable(key, value = nil)
get_or_set :namespace_inheritable, key, value
@@ -92,10 +92,16 @@
# (see #global_setting)
def namespace_stackable(key, value = nil)
get_or_set :namespace_stackable, key, value
end
+ def namespace_stackable_with_hash(key)
+ settings = get_or_set :namespace_stackable, key, nil
+ return if settings.blank?
+ settings.each_with_object({}) { |value, result| result.deep_merge!(value) }
+ end
+
# (see #unset_global_setting)
def unset_namespace_stackable(key)
unset :namespace_stackable, key
end
@@ -104,10 +110,10 @@
get_or_set :api_class, key, value
end
# (see #unset_global_setting)
def unset_api_class_setting(key)
- unset :api_class_setting, key
+ unset :api_class, key
end
# 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.