Sha256: dbde93d0bf403996aa6cec72807ac7bee3fd211c5045030dde99461c998ec57b

Contents?: true

Size: 621 Bytes

Versions: 5

Compression:

Stored size: 621 Bytes

Contents

class Zendesk2::Client
  class Real
    def get_ticket_comments(params={})
      ticket_id = require_parameters(params, "ticket_id")

      request(
        :method => :get,
        :path => "/tickets/#{ticket_id}/comments.json"
      )
    end
  end # Real

  class Mock
    def get_ticket_comments(params={})
      ticket_id = require_parameters(params, "ticket_id")

      page(params,
           :ticket_comments,
           "/tickets/#{ticket_id}/comments.json",
           "comments", filter: lambda { |comments| comments.select { |comment| comment["ticket_id"].to_s == ticket_id.to_s } })
    end
  end # Mock
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
zendesk2-1.4.2 lib/zendesk2/client/requests/get_ticket_comments.rb
zendesk2-1.4.1 lib/zendesk2/client/requests/get_ticket_comments.rb
zendesk2-1.4.0 lib/zendesk2/client/requests/get_ticket_comments.rb
zendesk2-1.3.3 lib/zendesk2/client/requests/get_ticket_comments.rb
zendesk2-1.3.2 lib/zendesk2/client/requests/get_ticket_comments.rb