Class: OpenapiParameters::Cookie
- Inherits:
-
Object
- Object
- OpenapiParameters::Cookie
- Defined in:
- lib/openapi_parameters/cookie.rb
Overview
Cookie parses OpenAPI cookie parameters from a cookie string.
Instance Method Summary collapse
-
#initialize(parameters, convert: true) ⇒ Cookie
constructor
A new instance of Cookie.
- #unpack(cookie_string) ⇒ Object
Constructor Details
Instance Method Details
#unpack(cookie_string) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/openapi_parameters/cookie.rb', line 14 def unpack() = Rack::Utils.() parameters.each_with_object({}) do |parameter, result| next unless .key?(parameter.name) result[parameter.name] = catch :skip do value = Unpacker.unpack_value(parameter, [parameter.name]) @convert ? Converter.convert(value, parameter.schema) : value end end end |