Class: Iremix::User

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ User

Returns a new instance of User.



6
7
8
# File 'lib/iremix/user.rb', line 6

def initialize(attrs = {})
  attrs.each do |k, v| send("#{k}=", v) end
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#emailObject

Returns the value of attribute email.



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

def email
  @email
end

#first_nameObject

Returns the value of attribute first_name.



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

def first_name
  @first_name
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#last_nameObject

Returns the value of attribute last_name.



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

def last_name
  @last_name
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#profile_photoObject

Returns the value of attribute profile_photo.



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

def profile_photo
  @profile_photo
end

#statusObject

Returns the value of attribute status.



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

def status
  @status
end

#updated_atObject

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

Class Method Details

.current(token) ⇒ Object



11
12
13
14
15
16
# File 'lib/iremix/user.rb', line 11

def current(token)
  response = token.get('/api/v1/people/current.json',
                       :params => { :access_token => token.token })

  new(response.parsed)
end