Class: OpenapiParameters::Unpackers::DelimitedArray
- Inherits:
-
Data
- Object
- Data
- OpenapiParameters::Unpackers::DelimitedArray
- Defined in:
- lib/openapi_parameters/unpackers.rb
Instance Attribute Summary collapse
-
#delimiter ⇒ Object
readonly
Returns the value of attribute delimiter.
-
#strip_prefix ⇒ Object
readonly
Returns the value of attribute strip_prefix.
Instance Method Summary collapse
Instance Attribute Details
#delimiter ⇒ Object (readonly)
Returns the value of attribute delimiter
27 28 29 |
# File 'lib/openapi_parameters/unpackers.rb', line 27 def delimiter @delimiter end |
#strip_prefix ⇒ Object (readonly)
Returns the value of attribute strip_prefix
27 28 29 |
# File 'lib/openapi_parameters/unpackers.rb', line 27 def strip_prefix @strip_prefix end |
Instance Method Details
#call(value) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/openapi_parameters/unpackers.rb', line 28 def call(value) return value if value.is_a?(::Array) return value if value.empty? value = value[1..] if strip_prefix value.split(delimiter) end |