Class: CommandMapper::Types::KeyValueList
- Defined in:
- lib/command_mapper/types/key_value_list.rb
Overview
Represents a list of key=value
pairs.
Instance Attribute Summary
Attributes inherited from List
Instance Method Summary collapse
-
#format(value) ⇒ String
Formats the value.
-
#initialize(separator: ',', key_value_separator: '=', **kwargs) ⇒ KeyValueList
constructor
Initializes the key-value list.
Methods inherited from List
Methods inherited from Type
Constructor Details
#initialize(separator: ',', key_value_separator: '=', **kwargs) ⇒ KeyValueList
Initializes the key-value list.
23 24 25 26 27 28 |
# File 'lib/command_mapper/types/key_value_list.rb', line 23 def initialize(separator: ',', key_value_separator: '=', **kwargs) super( type: KeyValue.new(separator: key_value_separator, **kwargs), separator: separator ) end |
Instance Method Details
#format(value) ⇒ String
Formats the value.
41 42 43 |
# File 'lib/command_mapper/types/key_value_list.rb', line 41 def format(value) super(Array(value).map(&@type.method(:format))) end |