Sha256: febc8ba9425e426a5f991d21c013ecb866eec6be9b8f17646728ec54e0b79909
Contents?: true
Size: 607 Bytes
Versions: 5
Compression:
Stored size: 607 Bytes
Contents
require 'json-schema' module Fitting class Records class Unit class JsonSchema def initialize(json_schema, tested_bodies) @json_schema = json_schema @tested_bodies = tested_bodies end def bodies @bodies ||= @tested_bodies.inject([]) do |res, tested_body| begin next res unless JSON::Validator.validate(@json_schema, tested_body) res.push(tested_body) rescue JSON::Schema::UriError res.push(tested_body) end end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems