Class: Apipie::Generator::Swagger::ParamDescription::In

Inherits:
Object
  • Object
show all
Defined in:
lib/apipie/generator/swagger/param_description/in.rb

Constant Summary collapse

IN_KEYWORD_DEFAULT_VALUES =
{
  form_data: 'formData',
  query: 'query'
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(param_description, in_schema:, default_in_value:, http_method:) ⇒ In

Returns a new instance of In.



7
8
9
10
11
12
# File 'lib/apipie/generator/swagger/param_description/in.rb', line 7

def initialize(param_description, in_schema:, default_in_value:, http_method:)
  @param_description = param_description
  @in_schema = in_schema
  @default_in_value = default_in_value
  @http_method = http_method
end

Instance Method Details

#to_hashHash

Returns:

  • (Hash)


15
16
17
18
19
20
# File 'lib/apipie/generator/swagger/param_description/in.rb', line 15

def to_hash
  # The "name" and "in" keys can only be set on root parameters (non-nested)
  return {} if @in_schema

  { in: in_value }
end