Class: Parliament::Builder::BaseResponseBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/parliament/builder/base_response_builder.rb

Overview

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

Since:

  • 0.7.5

Instance Method Summary collapse

Constructor Details

#initialize(response:, decorators: nil) ⇒ BaseResponseBuilder

Creates a new BaseResponseBuilder.

Parameters:

  • response (HTTPResponse)

    an HTTP response.

  • decorators (Module) (defaults to: nil)

    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.

Since:

  • 0.7.5



9
10
11
12
# File 'lib/parliament/builder/base_response_builder.rb', line 9

def initialize(response:, decorators: nil)
  @response = response
  _ = decorators
end

Instance Method Details

#buildParliament::Response::Base::Response

Builds a Parliament::Response::BaseResponse.

Returns:

  • (Parliament::Response::Base::Response)

    a Parliament::Response::BaseResponse containing the HTTPResponse.

Since:

  • 0.7.5



17
18
19
# File 'lib/parliament/builder/base_response_builder.rb', line 17

def build
  Parliament::Response::BaseResponse.new(@response)
end