Class: Kentico::Kontent::Delivery::Responses::ResponseBase
- Inherits:
-
Object
- Object
- Kentico::Kontent::Delivery::Responses::ResponseBase
- Defined in:
- lib/delivery/responses/response_base.rb
Overview
Base class for all responses from a Kentico::Kontent::Delivery::DeliveryQuery.execute call.
Direct Known Subclasses
DeliveryElementResponse, DeliveryItemListingResponse, DeliveryItemResponse, DeliveryTaxonomyListingResponse, DeliveryTaxonomyResponse, DeliveryTypeListingResponse, DeliveryTypeResponse
Instance Attribute Summary collapse
-
#http_code ⇒ Object
Returns the value of attribute http_code.
-
#json ⇒ Object
Returns the value of attribute json.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(http_code, message, json = '') ⇒ ResponseBase
constructor
Constructor.
-
#to_s ⇒ Object
Provides an informative message about the success of the request by combining the status code and message.
Constructor Details
#initialize(http_code, message, json = '') ⇒ ResponseBase
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
-
json (
string
) optional The complete, unmodified JSON response from the server
-
18 19 20 21 22 |
# File 'lib/delivery/responses/response_base.rb', line 18 def initialize(http_code, , json = '') self.http_code = http_code self. = self.json = json end |
Instance Attribute Details
#http_code ⇒ Object
Returns the value of attribute http_code.
8 9 10 |
# File 'lib/delivery/responses/response_base.rb', line 8 def http_code @http_code end |
#json ⇒ Object
Returns the value of attribute json.
8 9 10 |
# File 'lib/delivery/responses/response_base.rb', line 8 def json @json end |
#message ⇒ Object
Returns the value of attribute message.
8 9 10 |
# File 'lib/delivery/responses/response_base.rb', line 8 def @message end |
Instance Method Details
#to_s ⇒ Object
Provides an informative message about the success of the request by combining the status code and message.
-
Returns:
-
string
-
29 30 31 |
# File 'lib/delivery/responses/response_base.rb', line 29 def to_s "Response is status code #{http_code} with message:\n#{}" end |