Class: CoreLibrary::ResponseFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/apimatic-core-interfaces/factories/response_factory.rb

Overview

An interface for the creation of SDK HttpResponse. This class should not be instantiated but should be used as a base class for the HttpResponse creation.

Instance Method Summary collapse

Instance Method Details

#create(_status_code, _reason_phrase, _headers, _raw_body, _request) ⇒ Object

The factory method for creating HttpResponse type.

Parameters:

  • _status_code (Integer)

    The status code returned by the server.

  • _reason_phrase (String)

    The reason phrase returned by the server.

  • _headers (Hash)

    headers The headers sent by the server in the response.

  • _raw_body (String)

    The raw body of the response.

  • _request (HttpRequest)

    The request that resulted in this response.

Raises:

  • (NotImplementedError)


12
13
14
15
# File 'lib/apimatic-core-interfaces/factories/response_factory.rb', line 12

def create(_status_code, _reason_phrase, _headers, _raw_body, _request)
  raise NotImplementedError, 'This method needs
      to be implemented in a child class.'
end