class Kentico::Kontent::Delivery::Responses::ResponseBase

Base class for all responses from a Kentico::Kontent::Delivery::DeliveryQuery.execute call.

Attributes

http_code[RW]
json[RW]
message[RW]

Public Class Methods

new(http_code, message, json = '') click to toggle source

Constructor.

  • Args:

    • http_code (integer) The status code returned by the REST request

    • message (string) An informative message about the response, visible when calling to_s

    • json (string) optional The complete, unmodified JSON response from the server

# File lib/delivery/responses/response_base.rb, line 18
def initialize(http_code, message, json = '')
  self.http_code = http_code
  self.message = message
  self.json = json
end

Public Instance Methods

to_s() click to toggle source

Provides an informative message about the success of the request by combining the status code and message.

  • Returns:

    • string

# File lib/delivery/responses/response_base.rb, line 29
def to_s
  "Response is status code #{http_code} with message:\n#{message}"
end