Class: Kentico::Kontent::Delivery::Responses::DeliveryTypeResponse

Inherits:
ResponseBase
  • Object
show all
Defined in:
lib/delivery/responses/delivery_type_response.rb

Overview

The response of a successful query for a content type. See github.com/Kentico/kontent-delivery-sdk-ruby#retrieving-content-types

Instance Attribute Summary

Attributes inherited from ResponseBase

#http_code, #json, #message

Instance Method Summary collapse

Methods inherited from ResponseBase

#to_s

Constructor Details

#initialize(response) ⇒ DeliveryTypeResponse

Returns a new instance of DeliveryTypeResponse.



21
22
23
24
25
26
# File 'lib/delivery/responses/delivery_type_response.rb', line 21

def initialize(response)
  @response = response
  super 200,
        "Success, type '#{type.system.codename}' returned",
        JSON.generate(@response)
end

Instance Method Details

#typeObject

A Kentico::Kontent::Delivery::ContentType object from a Kentico::Kontent::Delivery::DeliveryClient.type call.

  • Returns:

    • Kentico::Kontent::Delivery::ContentType



16
17
18
19
# File 'lib/delivery/responses/delivery_type_response.rb', line 16

def type
  @type unless @type.nil?
  @type = Kentico::Kontent::Delivery::ContentType.new(@response)
end