Sha256: b2ec2bb336fffedd7029eb0c07726d26ec0309d65d3ff78f42a3e1e0afa69a70

Contents?: true

Size: 679 Bytes

Versions: 2

Compression:

Stored size: 679 Bytes

Contents

# -*- encoding : utf-8 -*-
module Pacto
  module Formats
    module Swagger
      class ResponseClause
        extend Forwardable
        include Pacto::ResponseClause
        attr_reader :swagger_response

        def_delegators :swagger_response, :schema

        def initialize(swagger_response, _base_data = {})
          @swagger_response = swagger_response
        end

        def status
          swagger_response.status_code || 200
        end

        def headers
          swagger_response.headers || {}
        end

        def schema
          return nil unless swagger_response.schema
          swagger_response.schema.parse
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pacto-0.4.0.rc3 lib/pacto/formats/swagger/response_clause.rb
pacto-0.4.0.rc2 lib/pacto/formats/swagger/response_clause.rb