Sha256: 9511bc39bde1bfe474be725b20381dcd94e88d0913994bcb93cac03d3c7a4b41

Contents?: true

Size: 347 Bytes

Versions: 4

Compression:

Stored size: 347 Bytes

Contents

module Lutaml
  module Model
    class ValidationError < Error
      attr_reader :errors

      def initialize(errors)
        @errors = errors
        super(errors.join(", "))
      end

      def include?(error_class)
        errors.any?(error_class)
      end

      def error_messages
        errors.map(&:message)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lutaml-model-0.3.28 lib/lutaml/model/error/validation_error.rb
lutaml-model-0.3.27 lib/lutaml/model/error/validation_error.rb
lutaml-model-0.3.26 lib/lutaml/model/error/validation_error.rb
lutaml-model-0.3.25 lib/lutaml/model/error/validation_error.rb