Sha256: d0f1c51f80ab6aa5fa405cb90319fc45c462e87cf2222feec94d30c3de0f3a4a
Contents?: true
Size: 671 Bytes
Versions: 17
Compression:
Stored size: 671 Bytes
Contents
require 'json-schema' module Fitting class Records class Unit class Combination attr_reader :description, :json_schema, :bodies def initialize(comb, bodies) @description = comb[1] @json_schema = comb[0] @bodies = bodies end def valid_bodies @valid_bodies ||= @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
17 entries across 17 versions & 1 rubygems