class Kentico::Kontent::Delivery::Responses::ResponseBase
Base class for all responses from a Kentico::Kontent::Delivery::DeliveryQuery.execute
call.
Attributes
headers[RW]
http_code[RW]
json[RW]
message[RW]
Public Class Methods
new(http_code, message, headers = {}, 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 callingto_s
-
headers (
hash
) optional The headers of the REST response -
json (
string
) optional The complete, unmodified JSON response from the server
-
# File lib/delivery/responses/response_base.rb, line 20 def initialize(http_code, message, headers = {}, json = '') self.http_code = http_code self.message = message self.headers = headers 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 32 def to_s "Response is status code #{http_code} with message:\n#{message}" end