class Kentico::Kontent::Delivery::Responses::DeliveryTaxonomyListingResponse

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

Public Class Methods

new(headers, body) click to toggle source
Calls superclass method
# File lib/delivery/responses/delivery_taxonomy_listing_response.rb, line 35
def initialize(headers, body)
  @response = JSON.parse(body)

  super 200,
        "Success, #{taxonomies.length} taxonomies returned",
        headers,
        JSON.generate(@response)
end

Public Instance Methods

pagination() click to toggle source

Parses the 'pagination' JSON node of the response.

# File lib/delivery/responses/delivery_taxonomy_listing_response.rb, line 16
def pagination
  @pagination unless @pagination.nil?
  @pagination = Pagination.new @response['pagination']
end
taxonomies() click to toggle source

Parses the 'taxonomies' JSON node of the response from a Kentico::Kontent::Delivery::DeliveryClient.taxonomies call.

# File lib/delivery/responses/delivery_taxonomy_listing_response.rb, line 26
def taxonomies
  @taxonomies unless @taxonomies.nil?
  taxonomies = []
  @response['taxonomies'].each do |n|
    taxonomies << Kentico::Kontent::Delivery::TaxonomyGroup.new(n)
  end
  @taxonomies = taxonomies
end