Sha256: e85c7367f0aa413a9f36a5744a564d06a3816a706a34a0e0bc819a171e1594fa

Contents?: true

Size: 865 Bytes

Versions: 1

Compression:

Stored size: 865 Bytes

Contents

module Parliament
  module Builder
    # Base response builder, allowing the user to return the body of an HTTPResponse.
    # @since 0.7.5
    class BaseResponseBuilder
      # Creates a new BaseResponseBuilder.
      # @param [HTTPResponse] response an HTTP response.
      # @param [Module] decorators a namespace which contains modules used to decorate the objects we receive.  It is not used directly by the BaseResponseBuilder, but is there for API completeness.
      def initialize(response:, decorators: nil)
        @response = response
        _ = decorators
      end

      # Builds a Parliament::Response::BaseResponse.
      #
      # @return [Parliament::Response::Base::Response] a Parliament::Response::BaseResponse containing the HTTPResponse.
      def build
        Parliament::Response::BaseResponse.new(@response)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
parliament-ruby-1.0.2 lib/parliament/builder/base_response_builder.rb