Class: OpenapiParameters::Unpackers::DelimitedObject

Inherits:
Data
  • Object
show all
Defined in:
lib/openapi_parameters/unpackers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#delimiterObject (readonly)

Returns the value of attribute delimiter

Returns:

  • (Object)

    the current value of delimiter



54
55
56
# File 'lib/openapi_parameters/unpackers.rb', line 54

def delimiter
  @delimiter
end

Instance Method Details

#call(value) ⇒ Object



55
56
57
58
59
60
# File 'lib/openapi_parameters/unpackers.rb', line 55

def call(value)
  entries = value.split(delimiter)
  throw :skip, value if entries.length.odd?

  Hash[*entries]
end