Sha256: b177285a773cc0d80cae5615bf290e8e64ecce918f460c24122ec5f09f885cdb

Contents?: true

Size: 429 Bytes

Versions: 8

Compression:

Stored size: 429 Bytes

Contents

class Zendesk2::Client::GetUserMemberships < Zendesk2::Client::Request
  request_method :get
  request_path  { |r| "/users/#{r.user_id}/organization_memberships.json" }

  page_params!

  def user_id
    params.fetch("membership").fetch("user_id").to_i
  end

  def mock
    collection = self.data[:memberships].values.select { |m| m["user_id"] == user_id }

    resources(collection, root: "organization_memberships")
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
zendesk2-1.5.10 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.5.9 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.5.8 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.5.7 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.5.6 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.5.5 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.5.4 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.5.3 lib/zendesk2/client/requests/get_user_memberships.rb