Sha256: 913169df2fbd740077923b729db3146060886425c8802e8b5c0ee66b61b87b3a
Contents?: true
Size: 905 Bytes
Versions: 24
Compression:
Stored size: 905 Bytes
Contents
require 'fitting/records/unit/json_schema' module Fitting class Records class Unit class Response def initialize(documented_response, tested_responses) @documented_response = documented_response @tested_responses = tested_responses end def status @status ||= @documented_response['status'] end def json_schemas @json_schemas ||= @documented_response['json_schemas'].inject([]) do |res, documented_json_schema| res.push(Fitting::Records::Unit::JsonSchema.new(documented_json_schema, tested_bodies)) end end def tested_bodies @tested_bodies ||= @tested_responses.inject([]) do |res, tested_response| next res unless status == tested_response.status.to_s res.push(tested_response.body) end end end end end end
Version data entries
24 entries across 24 versions & 1 rubygems