module Eco module API module Common module People class DefaultParsers class MultiParser < People::BaseParser def process @parsers.define_attribute(:multiple) do |parser| parser.def_parser do |value| return value if value.is_a?(Array) value = value.split("|") if value&.include?("|") into_a(value) end.def_serializer do |value| into_a(value).join("|") end end end private def into_a(value) value = [] if value == nil value = [].push(value) unless value.is_a?(Array) value end end end end end end end