Sha256: 3c9b6538fe0e20c4fad84fea6f4990c792e204f8aaad34a659813199fcf3f471

Contents?: true

Size: 629 Bytes

Versions: 26

Compression:

Stored size: 629 Bytes

Contents

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

      request(
        :params  => page_params,
        :method  => :get,
        :path    => "/users/#{user_id}/organization_memberships.json",
      )
    end
  end # Real

  class Mock
    def get_user_memberships(params={})
      user_id = params["user_id"]

      resources(:memberships, "/users/#{user_id}/organization_memberships.json", "organization_memberships", filter: lambda{|c| c.select { |a| a["user_id"] == user_id }})
    end
  end # Mock
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
zendesk2-1.4.2 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.4.1 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.4.0 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.3.3 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.3.2 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.3.1 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.3.0 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.2.10 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.2.9 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.2.7 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.2.6 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.2.5 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.2.4 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.2.3 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.2.2 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.2.1 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.2.0 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.1.3 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.1.2 lib/zendesk2/client/requests/get_user_memberships.rb
zendesk2-1.0.0 lib/zendesk2/client/requests/get_user_memberships.rb