Class: Sail::Types::Set
Overview
Set
This type allows defining a set
using a string and a separator
(defined in the configuration).
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/set.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/set.rb', line 11 def to_value ::Set[*@setting.value.split(Sail.configuration.array_separator)] end |