Class: Zendesk::Client::UsersCollection

Inherits:
Zendesk::Collection show all
Defined in:
lib/zendesk/client/users.rb

Instance Attribute Summary

Attributes included from Paginator

#query

Instance Method Summary collapse

Methods inherited from Zendesk::Collection

#create, #delete, #get, #post, #put, #update

Methods included from Paginator

#[], #clear_cache, #each, #fetch, #method_missing, #page, #per_page

Constructor Details

#initialize(client, *args) ⇒ UsersCollection



15
16
17
# File 'lib/zendesk/client/users.rb', line 15

def initialize(client, *args)
  super(client, :user, *args)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Zendesk::Paginator

Instance Method Details

#currentObject Also known as: me

## Get currently authenticated user

@zendesk.users.current


23
24
25
26
# File 'lib/zendesk/client/users.rb', line 23

def current
  @query[:path] += "/current"
  self
end

#identities(id = nil) ⇒ Object

## Get a user's identities (email addresses, twitter handles, etc)

@zendesk.users(123).identities


33
34
35
36
# File 'lib/zendesk/client/users.rb', line 33

def identities(id=nil)
  @query[:path] += "/user_identities/#{id}"
  self
end