Class: Sail::Types::Array
Overview
Array
This type allows defining an array using a string and a separator (defined in the configuration).
Direct Known Subclasses
Instance Method Summary collapse
Methods inherited from Type
Constructor Details
This class inherits a constructor from Sail::Types::Type
Instance Method Details
#from(value) ⇒ Object
15 16 17 |
# File 'lib/sail/types/array.rb', line 15 def from(value) value.is_a?(::String) ? value : value.join(Sail.configuration.array_separator) end |
#to_value ⇒ Object
11 12 13 |
# File 'lib/sail/types/array.rb', line 11 def to_value @setting.value.split(Sail.configuration.array_separator) end |