Sha256: 7bbdc5fe8f766b7781c7b379a74afe91da3c6c4c11081b830ca879bed5917f18

Contents?: true

Size: 665 Bytes

Versions: 18

Compression:

Stored size: 665 Bytes

Contents

class Zendesk2::Client
  class Real
    def get_topic_comments(params={})
      topic_id    = params.delete("topic_id")
      page_params = Zendesk2.paging_parameters(params)

      request(
        :params => page_params,
        :path   => "/topics/#{topic_id}/comments.json",
      )
    end
  end
  class Mock
    def get_topic_comments(params={})
      topic_id = params["topic_id"]
      topic    = self.data[:topics][topic_id] # TODO: 404 if !topic
      filter   = lambda{|comments| comments.select{|c| c["topic_id"] == topic_id}}

      page(params, :topic_comments, "/topics/#{topic_id}/comments.json", "topic_comments", filter: filter)
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
zendesk2-0.3.2 lib/zendesk2/client/requests/get_topic_comments.rb
zendesk2-0.3.1 lib/zendesk2/client/requests/get_topic_comments.rb
zendesk2-0.3.0 lib/zendesk2/client/requests/get_topic_comments.rb
zendesk2-0.2.7 lib/zendesk2/client/requests/get_topic_comments.rb
zendesk2-0.2.6 lib/zendesk2/client/requests/get_topic_comments.rb
zendesk2-0.2.5 lib/zendesk2/client/requests/get_topic_comments.rb
zendesk2-0.2.4 lib/zendesk2/client/requests/get_topic_comments.rb
zendesk2-0.2.3 lib/zendesk2/client/requests/get_topic_comments.rb
zendesk2-0.2.2 lib/zendesk2/client/requests/get_topic_comments.rb
zendesk2-0.2.1 lib/zendesk2/client/requests/get_topic_comments.rb
zendesk2-0.2.0 lib/zendesk2/client/requests/get_topic_comments.rb
zendesk2-0.1.3 lib/zendesk2/client/requests/get_topic_comments.rb
zendesk2-0.1.2 lib/zendesk2/client/requests/get_topic_comments.rb
zendesk2-0.1.1 lib/zendesk2/client/requests/get_topic_comments.rb
zendesk2-0.1.0 lib/zendesk2/client/requests/get_topic_comments.rb
zendesk2-0.0.23 lib/zendesk2/client/requests/get_topic_comments.rb
zendesk2-0.0.22 lib/zendesk2/client/requests/get_topic_comments.rb
zendesk2-0.0.20 lib/zendesk2/client/requests/get_topic_comments.rb