Class: Zendesk2::GetTopicComments

Inherits:
Object
  • Object
show all
Includes:
Request
Defined in:
lib/zendesk2/get_topic_comments.rb

Instance Attribute Summary

Attributes included from Request

#params

Instance Method Summary collapse

Methods included from Request

#call, cistern_included, #data, #delete!, #error!, #find!, #html_url_for, included, #mock_response, #page, #page_params!, #page_params?, #pluralize, #real, #real_request, #request_body, #request_params, #request_path, #resources, #response, #timestamp, #url_for

Instance Method Details

#mockObject



14
15
16
17
18
19
20
# File 'lib/zendesk2/get_topic_comments.rb', line 14

def mock
  find!(:topics, topic_id)

  topic_comments = data[:topic_comments].values.select { |c| c['topic_id'] == topic_id }

  page(topic_comments, root: 'topic_comments')
end

#topic_idObject



10
11
12
# File 'lib/zendesk2/get_topic_comments.rb', line 10

def topic_id
  params.fetch('topic_id')
end