Sha256: 2e3393af28b2a15a5cc762f28dd0116f1ea1dba4b5553f5f8b92a0c1540c3531
Contents?: true
Size: 485 Bytes
Versions: 15
Compression:
Stored size: 485 Bytes
Contents
class Zendesk2::Client::GetUserOrganizations < Zendesk2::Client::Request request_method :get request_path { |r| "/users/#{r.user_id}/organizations.json" } page_params! def user_id params.fetch("user_id").to_i end def mock memberships = self.data[:memberships].values.select { |m| m["user_id"] == user_id } organizations = memberships.map { |m| self.data[:organizations].fetch(m["organization_id"]) } page(organizations, root: "organizations") end end
Version data entries
15 entries across 15 versions & 1 rubygems