Sha256: b3902c7a81dfc52ba1e2d4d2b49aae8963873267ddfd1335de95922b03d62913
Contents?: true
Size: 424 Bytes
Versions: 6
Compression:
Stored size: 424 Bytes
Contents
# frozen_string_literal: true module RenderEditorjs class Validator attr_reader :data, :schema, :errors def initialize(data, schema) @data = data @schema = schema @errors = [] end def valid? validate! rescue JSON::Schema::ValidationError => e @errors << e.message false end def validate! JSON::Validator.validate!(schema, data) end end end
Version data entries
6 entries across 6 versions & 1 rubygems