Sha256: b16e01eea5031241a4ae05a686645bcb61f04371d8692b6dd0330326ef0b2525
Contents?: true
Size: 789 Bytes
Versions: 6
Compression:
Stored size: 789 Bytes
Contents
module Esplanade class Response class Doc def initialize(request, raw) @request = request @raw = raw end def tomogram @tomogram ||= @request.doc.responses.find_all { |response| response['status'] == @raw.status } raise NotDocumented.new(**message) if @tomogram == [] @tomogram end def json_schemas @json_schemas ||= tomogram.map { |action| action['body'] } end def status @status ||= tomogram['status'] end private def message { request: { method: @request.raw.method, raw_path: @request.raw.raw_path, path: @request.raw.path }, status: @raw.status } end end end end
Version data entries
6 entries across 6 versions & 1 rubygems