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(response)
click to toggle source
Calls superclass method
# File lib/delivery/responses/delivery_taxonomy_listing_response.rb, line 35 def initialize(response) @response = response super 200, "Success, #{taxonomies.length} taxonomies returned", 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.
-
Returns:
-
Array
The taxonomy groups asKentico::Kontent::Delivery::TaxonomyGroup
objects
-
# 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