Class: RailsSettings::Fields::Array
- Defined in:
- lib/rails-settings/fields/array.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
#default, #key, #options, #parent, #readonly, #scope, #separator, #type
Instance Method Summary collapse
Methods inherited from Base
#default_value, generate, #initialize, #read, #save!, #saved_value, #table_exists?, #to_h
Constructor Details
This class inherits a constructor from RailsSettings::Fields::Base
Instance Method Details
#deserialize(value) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/rails-settings/fields/array.rb', line 4 def deserialize(value) return nil if value.nil? return value unless value.is_a?(::String) value.split(separator).reject(&:empty?).map(&:strip) end |
#serialize(value) ⇒ Object
12 13 14 |
# File 'lib/rails-settings/fields/array.rb', line 12 def serialize(value) deserialize(value) end |