Sha256: 046985cafe1fbc44215c5d4e46d287f7074c9f444a102b385b0be34685146c1e

Contents?: true

Size: 317 Bytes

Versions: 2

Compression:

Stored size: 317 Bytes

Contents

module Pacto
  class ResponseClause
    attr_reader :status, :headers, :schema

    def initialize(definition)
      @status = definition['status']
      @headers = definition['headers']
      @schema = definition['body'] || {}
    end

    def body
      @body ||= JSON::Generator.generate(schema)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pacto-0.3.1 lib/pacto/response_clause.rb
pacto-0.3.0 lib/pacto/response_clause.rb