Module: SoberSwag::Types::CommaArray
- Defined in:
- lib/sober_swag/types/comma_array.rb
Overview
An array that will be parsed from comma-separated values in a string, if given a string.
Class Method Summary collapse
-
.of(other) ⇒ SoberSwag::Types::CommaArray
Get a parser that will parse comma-separated values of another type.
Class Method Details
.of(other) ⇒ SoberSwag::Types::CommaArray
Get a parser that will parse comma-separated values of another type.
10 11 12 13 14 15 16 17 18 |
# File 'lib/sober_swag/types/comma_array.rb', line 10 def self.of(other) SoberSwag::Types::Array.of(other).constructor { |val| if val.is_a?(::String) val.split(',').map(&:strip) else val end }.(style: :form, explode: false) end |