Module: Zendesk2::HelpCenter::SubscriptionRequest
- Included in:
- CreateHelpCenterSubscription, DestroyHelpCenterSubscription, GetHelpCenterSubscription, GetHelpCenterSubscriptions, UpdateHelpCenterSubscription
- Defined in:
- lib/zendesk2/help_center/subscription_request.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
- #content_id ⇒ Object
- #content_type ⇒ Object
- #plural_content_type ⇒ Object
- #route_prefix ⇒ Object
- #subscription ⇒ Object
- #subscription_id ⇒ Object
Class Method Details
.included(klass) ⇒ Object
3 4 5 6 |
# File 'lib/zendesk2/help_center/subscription_request.rb', line 3 def self.included(klass) super klass.extend(ClassMethods) end |
Instance Method Details
#content_id ⇒ Object
38 39 40 |
# File 'lib/zendesk2/help_center/subscription_request.rb', line 38 def content_id subscription.fetch('content_id').to_i end |
#content_type ⇒ Object
34 35 36 |
# File 'lib/zendesk2/help_center/subscription_request.rb', line 34 def content_type subscription.fetch('content_type') end |
#plural_content_type ⇒ Object
30 31 32 |
# File 'lib/zendesk2/help_center/subscription_request.rb', line 30 def plural_content_type pluralize(content_type) end |
#route_prefix ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/zendesk2/help_center/subscription_request.rb', line 21 def route_prefix case content_type when 'topic', 'post' 'community' else 'help_center' end end |
#subscription ⇒ Object
46 47 48 |
# File 'lib/zendesk2/help_center/subscription_request.rb', line 46 def subscription Cistern::Hash.stringify_keys(params.fetch('subscription')) end |
#subscription_id ⇒ Object
42 43 44 |
# File 'lib/zendesk2/help_center/subscription_request.rb', line 42 def subscription_id subscription.fetch('id') end |