Sha256: eaa9ed9adafb1d3e408d04a2cb9e287cd22079c637c03f2b79ca436e484a8e2e

Contents?: true

Size: 642 Bytes

Versions: 1

Compression:

Stored size: 642 Bytes

Contents

# frozen_string_literal: true

module Pragma
  module Operation
    class Response
      # Represents the 402 Payment Required HTTP response.
      class PaymentRequired < Response
        # Initializes the response.
        #
        # @param entity [Object] the response's entity
        # @param headers [Hash] the response's headers
        def initialize(
          entity: Error.new(
            error_type: :payment_required,
            error_message: 'This resource requires payment.'
          ),
          headers: {}
        )
          super(status: 402, entity: entity, headers: headers)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pragma-operation-2.2.0 lib/pragma/operation/response/payment_required.rb