Sha256: 1e1639a2c5b46bbe7c08b106b02d7a996470af0933d9d812fad84cd0ea7e7df3

Contents?: true

Size: 676 Bytes

Versions: 8

Compression:

Stored size: 676 Bytes

Contents

require 'esplanade/response/doc'
require 'esplanade/response/raw'
require 'esplanade/response/validation'

module Esplanade
  class Response
    class Error < Esplanade::Error; end
    class NotDocumented < Error; end
    class BodyIsNotJson < Error; end
    class Invalid       < Error; end

    attr_reader :request

    def initialize(request, status, raw_body)
      @request = request
      @status = status
      @raw_body = raw_body
    end

    def doc
      @doc ||= Doc.new(@request, raw)
    end

    def raw
      @raw ||= Raw.new(@request, @status, @raw_body)
    end

    def validation
      @validation ||= Validation.new(@request, doc, raw)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
esplanade-1.3.0 lib/esplanade/response.rb
esplanade-1.2.1 lib/esplanade/response.rb
esplanade-1.2.0 lib/esplanade/response.rb
esplanade-1.1.2 lib/esplanade/response.rb
esplanade-1.1.1 lib/esplanade/response.rb
esplanade-1.1.0 lib/esplanade/response.rb
esplanade-1.0.1 lib/esplanade/response.rb
esplanade-1.0.0 lib/esplanade/response.rb