Sha256: b550f6282e2b58795206798f1b684a91f1e6ec58ab23779139b564b1237c197b

Contents?: true

Size: 672 Bytes

Versions: 1

Compression:

Stored size: 672 Bytes

Contents

# frozen_string_literal: true

module Pragma
  module Operation
    class Response
      # Represents the 503 Service Unavailable HTTP response.
      class ServiceUnavailable < 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: :service_unavailable,
            error_message: 'This resource is not available right now. Try later.'
          ),
          headers: {}
        )
          super(status: 503, 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/service_unavailable.rb