Class: Kentico::Kontent::Delivery::Responses::DeliveryTaxonomyResponse

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

Overview

The response of a successful query for a taxonomy group. See github.com/Kentico/kontent-delivery-sdk-ruby#taxonomy

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) ⇒ DeliveryTaxonomyResponse

Returns a new instance of DeliveryTaxonomyResponse.



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

def initialize(response)
  @response = response

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

Instance Method Details

#taxonomyObject

Parses the response from a Kentico::Kontent::Delivery::DeliveryClient.taxonomy call.

  • Returns:

    • Kentico::Kontent::Delivery::TaxonomyGroup



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

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