Sha256: 9b82bca0c186068b94843a89b52429f521beda8b9c474cf3f7fb31f6b3654ed9
Contents?: true
Size: 985 Bytes
Versions: 6
Compression:
Stored size: 985 Bytes
Contents
class Zendesk2::Client::HelpCenter::Sections < Zendesk2::Client::Collection include Zendesk2::PagedCollection include Zendesk2::Searchable model Zendesk2::Client::HelpCenter::Section self.collection_method = :get_help_center_sections self.collection_root = "sections" self.model_method = :get_help_center_section self.model_root = "section" attribute :category_id, type: :integer scopes << :category_id def collection_page(params={}) collection_method = if category_id :get_help_center_categories_sections else :get_help_center_sections end body = service.send(collection_method, Cistern::Hash.stringify_keys(self.attributes.merge(params))).body self.load(body[collection_root]) # 'results' is the key for paged searches self.merge_attributes(Cistern::Hash.slice(body, "count", "next_page", "previous_page")) self end end
Version data entries
6 entries across 6 versions & 1 rubygems