Class: OpenapiParameters::Unpackers::MatrixArray

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#explodeObject (readonly)

Returns the value of attribute explode

Returns:

  • (Object)

    the current value of explode



37
38
39
# File 'lib/openapi_parameters/unpackers.rb', line 37

def explode
  @explode
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



37
38
39
# File 'lib/openapi_parameters/unpackers.rb', line 37

def name
  @name
end

Instance Method Details

#call(value) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/openapi_parameters/unpackers.rb', line 38

def call(value)
  return value if value.is_a?(::Array)
  return value if value.empty?

  result = Rack::Utils.parse_query(value, ';')[name]
  explode ? result : result.split(',')
end