Sha256: 4658da4464e210d25190ddeccab1b4d5282fb4b1024eb939ce79ebac279185db

Contents?: true

Size: 412 Bytes

Versions: 6

Compression:

Stored size: 412 Bytes

Contents

# frozen_string_literal: true
class Zendesk2::GetUserMemberships
  include Zendesk2::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
    page(data[:memberships].values.select { |m| m['user_id'] == user_id }, root: 'organization_memberships')
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
zendesk2-1.15.0 lib/zendesk2/get_user_memberships.rb
zendesk2-1.13.1 lib/zendesk2/get_user_memberships.rb
zendesk2-1.13.0 lib/zendesk2/get_user_memberships.rb
zendesk2-1.12.0 lib/zendesk2/get_user_memberships.rb
zendesk2-1.11.0 lib/zendesk2/get_user_memberships.rb
zendesk2-1.10.0 lib/zendesk2/get_user_memberships.rb