class PGTrunk::Serializers::ArrayOfSymbolsSerializer

@private The same as the array of strings with symbolization at the end

Public Instance Methods

cast(value) click to toggle source
# File lib/pg_trunk/core/serializers/array_of_symbols_serializer.rb, line 8
def cast(value)
  case value
  when ::NilClass then []
  when ::Symbol then [value]
  when ::String
    value.gsub(/^\{|\}$/, "").split(",").map(&:to_sym)
  when ::Array then value.map { |i| i.to_s.to_sym }
  else [value.to_s.to_sym]
  end
end
serialize(value) click to toggle source
# File lib/pg_trunk/core/serializers/array_of_symbols_serializer.rb, line 19
def serialize(value)
  value
end