Sha256: c6ac19935b172572faf7e2fdfbd9b732606066d38f01403976cd2cccf945d2dc
Contents?: true
Size: 591 Bytes
Versions: 16
Compression:
Stored size: 591 Bytes
Contents
module Lutaml module Model module Validation def validate errors = [] self.class.attributes.each do |name, attr| value = instance_variable_get(:"@#{name}") begin attr.validate_value!(value) rescue Lutaml::Model::InvalidValueError, Lutaml::Model::CollectionCountOutOfRangeError => e errors << e end end errors end def validate! errors = validate raise Lutaml::Model::ValidationError.new(errors) if errors.any? end end end end
Version data entries
16 entries across 16 versions & 1 rubygems