Module: Grape::DSL::Desc
Instance Attribute Summary
Attributes included from Settings
Instance Method Summary collapse
-
#desc(description, *legacy_options, **options) { ... } ⇒ Object
Add a description to the next namespace or function.
Methods included from Settings
global_setting, namespace_setting, route_setting, top_level_setting
Instance Method Details
#desc(description, *legacy_options, **options) { ... } ⇒ Object
Add a description to the next namespace or function.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/grape/dsl/desc.rb', line 53 def desc(description, *, **, &config_block) if .any? Grape.deprecator.warn('Passing a positional options Hash to `desc` is deprecated. Pass keyword arguments instead.') = .first.merge() end settings = if config_block endpoint_config = defined?(configuration) ? configuration : nil Grape::Util::ApiDescription.new(description, endpoint_config, &config_block).settings else .merge(description:) end inheritable_setting.namespace[:description] = settings inheritable_setting.route[:description] = settings end |