Sha256: c467b2a5b9eac6ee30800f60006fc740e7b6fea7dccc7b5ade0f48df8a99c0eb

Contents?: true

Size: 704 Bytes

Versions: 56

Compression:

Stored size: 704 Bytes

Contents

class Zendesk2::Client
  class Real
    def get_organization_tickets(params={})
      id          = params["id"]
      page_params = Zendesk2.paging_parameters(params)

      request(
        :params  => page_params,
        :method  => :get,
        :path    => "/organizations/#{id}/tickets.json",
      )
    end
  end # Real

  class Mock
    def get_organization_tickets(params={})
      id = params["id"]

      requesters = self.data[:users].values.select{|u| u["organization_id"] == id}.map{|s| s["organization_id"]}
      page(params, :tickets, "/organizations/#{id}/tickets.json", "tickets", filter: lambda{|c| c.select{|u| requesters.include?(u["organization_id"])}})
    end
  end # Mock
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
zendesk2-1.2.9 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-1.2.7 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-1.2.6 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-1.2.5 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-1.2.4 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-1.2.3 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-1.2.2 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-1.2.1 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-1.2.0 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-1.1.3 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-1.1.2 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-1.0.0 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-0.5.4 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-0.5.3 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-0.5.2 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-0.5.1 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-0.5.0 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-0.4.5 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-0.4.4 lib/zendesk2/client/requests/get_organization_tickets.rb
zendesk2-0.4.3 lib/zendesk2/client/requests/get_organization_tickets.rb