Class: Grape::Util::ApiDescription
- Inherits:
-
Object
- Object
- Grape::Util::ApiDescription
- Defined in:
- lib/grape/util/api_description.rb
Constant Summary collapse
- DSL_METHODS =
%i[ body_name consumes default_response deprecated detail entity headers hidden http_codes is_array named nickname params produces security summary tags ].freeze
Instance Method Summary collapse
- #configuration ⇒ Object
-
#default(value) ⇒ Object
deprecated
Deprecated.
Use #default_response. The description is read back through an ActiveSupport::OrderedOptions, where
defaultisHash#defaultrather than a key lookup, and grape-swagger has always asked the route fordefault_response. -
#initialize(description, endpoint_configuration) ⇒ ApiDescription
constructor
A new instance of ApiDescription.
- #settings ⇒ Object
Constructor Details
#initialize(description, endpoint_configuration) ⇒ ApiDescription
Returns a new instance of ApiDescription.
26 27 28 29 30 |
# File 'lib/grape/util/api_description.rb', line 26 def initialize(description, endpoint_configuration, &) @endpoint_configuration = endpoint_configuration @attributes = { description: } instance_eval(&) end |
Instance Method Details
#configuration ⇒ Object
50 51 52 |
# File 'lib/grape/util/api_description.rb', line 50 def configuration @configuration ||= eval_endpoint_config(@endpoint_configuration) end |
#default(value) ⇒ Object
Deprecated.
Use #default_response. The description is read back
through an ActiveSupport::OrderedOptions, where default is
Hash#default rather than a key lookup, and grape-swagger has always
asked the route for default_response.
45 46 47 48 |
# File 'lib/grape/util/api_description.rb', line 45 def default(value) Grape.deprecator.warn('`default` in a `desc` block is deprecated. Use `default_response` instead.') default_response(value) end |
#settings ⇒ Object
54 55 56 |
# File 'lib/grape/util/api_description.rb', line 54 def settings @attributes end |