Sha256: 91bafba82f0cc938456706c8e174db340ead0b2734c6fc10b0425c78379bdf1c
Contents?: true
Size: 544 Bytes
Versions: 5
Compression:
Stored size: 544 Bytes
Contents
module JSON class Schema class PatternAttribute < Attribute def self.validate(current_schema, data, fragments, validator, options = {}) if data.is_a?(String) r = Regexp.new(current_schema.schema['pattern']) if (r.match(data)).nil? message = "The property '#{build_fragment(fragments)}' did not match the regex '#{current_schema.schema['pattern']}'" validation_error(message, fragments, current_schema, options[:record_errors]) end end end end end end
Version data entries
5 entries across 5 versions & 2 rubygems