class Parliament::Builder::BaseResponseBuilder

Base response builder, allowing the user to return the body of an HTTPResponse. @since 0.7.5

Public Class Methods

new(response:, decorators: nil) click to toggle source

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.

# File lib/parliament/builder/base_response_builder.rb, line 9
def initialize(response:, decorators: nil)
  @response = response
  _ = decorators
end

Public Instance Methods

build() click to toggle source

Builds a Parliament::Response::BaseResponse.

@return [Parliament::Response::Base::Response] a Parliament::Response::BaseResponse containing the HTTPResponse.

# File lib/parliament/builder/base_response_builder.rb, line 17
def build
  Parliament::Response::BaseResponse.new(@response)
end