Sha256: cf3e9bd23615eb9c9807ac9bdb714756b84d0067aa3f1be2974481ec140d7c72
Contents?: true
Size: 696 Bytes
Versions: 6
Compression:
Stored size: 696 Bytes
Contents
# frozen_string_literal: true class Zendesk2::UpdateHelpCenterCategory include Zendesk2::Request request_method :put request_body { |r| { 'category' => r.category_params } } request_path do |r| locale = r.category_params['locale'] locale ? "/help_center/#{locale}/categories/#{r.category_id}.json" : "/help_center/categories/#{r.category_id}.json" end def category_params Cistern::Hash.slice(params.fetch('category'), *Zendesk2::CreateHelpCenterCategory.accepted_attributes) end def category_id params.fetch('category').fetch('id') end def mock mock_response('category' => find!(:help_center_categories, category_id).merge!(category_params)) end end
Version data entries
6 entries across 6 versions & 1 rubygems