Sha256: 2fa489bed5ea380e4038321a0b211cb0ec2dd6349d22696dded8e3a64bc60bc8

Contents?: true

Size: 461 Bytes

Versions: 6

Compression:

Stored size: 461 Bytes

Contents

# frozen_string_literal: true
class Zendesk2::GetHelpCenterCategory
  include Zendesk2::Request

  request_path do |r|
    locale = r.params.fetch('category')['locale']
    locale ? "/help_center/#{locale}/categories/#{r.category_id}.json" : "/help_center/categories/#{r.category_id}.json"
  end

  def category_id
    params.fetch('category').fetch('id')
  end

  def mock
    mock_response('category' => find!(:help_center_categories, category_id))
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
zendesk2-1.15.0 lib/zendesk2/help_center/get_help_center_category.rb
zendesk2-1.13.1 lib/zendesk2/help_center/get_help_center_category.rb
zendesk2-1.13.0 lib/zendesk2/help_center/get_help_center_category.rb
zendesk2-1.12.0 lib/zendesk2/help_center/get_help_center_category.rb
zendesk2-1.11.0 lib/zendesk2/help_center/get_help_center_category.rb
zendesk2-1.10.0 lib/zendesk2/help_center/get_help_center_category.rb