Sha256: 761d2fb36a2956316a0a57154225adfaf604521fa87af2f8529ba53021d1f24c

Contents?: true

Size: 483 Bytes

Versions: 122

Compression:

Stored size: 483 Bytes

Contents

class Eco::API::Common::People::DefaultParsers::MultiParser < Eco::API::Common::Loaders::Parser
  attribute :multiple

  def parser(value, deps)
    into_a(value)
  end

  def serializer(value, deps)
    into_a(value).join("|")
  end

  private

  def into_a(value)
    return []               if value.nil?
    return value            if value.is_a?(Array)
    return value.split("|") if value.is_a?(String) && value.include?("|")
    [].push(value)
  end

end

Version data entries

122 entries across 122 versions & 1 rubygems

Version Path
eco-helpers-2.0.50 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.49 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.48 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.47 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.46 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.45 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.44 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.43 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.42 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.41 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.40 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.39 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.38 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.37 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.36 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.35 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.34 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.33 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.32 lib/eco/api/common/people/default_parsers/multi_parser.rb
eco-helpers-2.0.31 lib/eco/api/common/people/default_parsers/multi_parser.rb