Exception: Lutaml::Model::ValidationError

Inherits:
Error
  • Object
show all
Defined in:
lib/lutaml/model/error/validation_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ ValidationError

Returns a new instance of ValidationError.



6
7
8
9
# File 'lib/lutaml/model/error/validation_error.rb', line 6

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

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



4
5
6
# File 'lib/lutaml/model/error/validation_error.rb', line 4

def errors
  @errors
end

Instance Method Details

#error_messagesObject



15
16
17
# File 'lib/lutaml/model/error/validation_error.rb', line 15

def error_messages
  errors.map(&:message)
end

#include?(error_class) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/lutaml/model/error/validation_error.rb', line 11

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