Sha256: ded81653aacfd25e7730fe487c9f138d14aafd286f9df06c33f2928e075ab656

Contents?: true

Size: 441 Bytes

Versions: 8

Compression:

Stored size: 441 Bytes

Contents

module ApiPack
  module Errors
    class ValidationErrorsSerializer
      attr_reader :record

      def initialize(record)
        @record = record
      end

      def serialize
        record.errors.messages.map do |field, messages|
          messages.map do |error_messages|
            ApiPack::Errors::ValidationErrorSerializer.new(record, field, error_messages).serialize
          end
        end.flatten
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
api_pack-1.3.1 lib/api_pack/errors/validation_errors_serializer.rb
api_pack-1.2.1 lib/api_pack/errors/validation_errors_serializer.rb
api_pack-1.1.4 lib/api_pack/errors/validation_errors_serializer.rb
api_pack-1.1.3 lib/api_pack/errors/validation_errors_serializer.rb
api_pack-1.1.2 lib/api_pack/errors/validation_errors_serializer.rb
api_pack-1.1.1 lib/api_pack/errors/validation_errors_serializer.rb
api_pack-1.0.1 lib/api_pack/errors/validation_errors_serializer.rb
api_pack-1.0.0 lib/api_pack/errors/validation_errors_serializer.rb