Class: Yammer::User

Inherits:
Object
  • Object
show all
Defined in:
lib/yammer/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(u, c) ⇒ User

Returns a new instance of User.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/yammer/user.rb', line 7

def initialize(u, c)
  @client = c
  @id = u['id']
  @url = u['url']
  @web_url = u['web_url']
  @name = u['name']
  @full_name = u['full_name']
  @mugshot_url = u['mugshot_url']
  @job_title = u['job_title']
  # These attributes will be nil when User is a reference
  @network_id = u['network_id']
  @location = u['location']
  @stats = u['stats']
  @contact = u['contact']
  @hire_date = u['hire_date']
  @birth_date = u['birth_date']
  @network_name = u['network_name']
end

Instance Attribute Details

#birth_dateObject (readonly)

Returns the value of attribute birth_date.



3
4
5
# File 'lib/yammer/user.rb', line 3

def birth_date
  @birth_date
end

#contactObject (readonly)

Returns the value of attribute contact.



3
4
5
# File 'lib/yammer/user.rb', line 3

def contact
  @contact
end

#full_nameObject (readonly)

Returns the value of attribute full_name.



3
4
5
# File 'lib/yammer/user.rb', line 3

def full_name
  @full_name
end

#full_userObject (readonly)

Returns the value of attribute full_user.



3
4
5
# File 'lib/yammer/user.rb', line 3

def full_user
  @full_user
end

#hire_dateObject (readonly)

Returns the value of attribute hire_date.



3
4
5
# File 'lib/yammer/user.rb', line 3

def hire_date
  @hire_date
end

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/yammer/user.rb', line 3

def id
  @id
end

#job_titleObject (readonly)

Returns the value of attribute job_title.



3
4
5
# File 'lib/yammer/user.rb', line 3

def job_title
  @job_title
end

#locationObject (readonly)

Returns the value of attribute location.



3
4
5
# File 'lib/yammer/user.rb', line 3

def location
  @location
end

#mugshot_urlObject (readonly)

Returns the value of attribute mugshot_url.



3
4
5
# File 'lib/yammer/user.rb', line 3

def mugshot_url
  @mugshot_url
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/yammer/user.rb', line 3

def name
  @name
end

#network_nameObject (readonly)

Returns the value of attribute network_name.



3
4
5
# File 'lib/yammer/user.rb', line 3

def network_name
  @network_name
end

#statsObject (readonly)

Returns the value of attribute stats.



3
4
5
# File 'lib/yammer/user.rb', line 3

def stats
  @stats
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/yammer/user.rb', line 3

def url
  @url
end

#web_urlObject (readonly)

Returns the value of attribute web_url.



3
4
5
# File 'lib/yammer/user.rb', line 3

def web_url
  @web_url
end

Instance Method Details

#me?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/yammer/user.rb', line 61

def me?
  @id == @client.me.id
end

#network_idObject



26
27
28
29
# File 'lib/yammer/user.rb', line 26

def network_id
  get_full_user unless @network_id
  @network_id
end