Class: Sail::Types::Array

Inherits:
Type
  • Object
show all
Defined in:
lib/sail/types/array.rb

Overview

Array

This type allows defining an array using a string and a separator (defined in the configuration).

Direct Known Subclasses

Locales

Instance Method Summary collapse

Methods inherited from Type

#initialize

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_valueObject



11
12
13
# File 'lib/sail/types/array.rb', line 11

def to_value
  @setting.value.split(Sail.configuration.array_separator)
end