Class: Viddler::User

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

Overview

This class wraps Viddler’s user’s information.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ User

:nodoc:



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/viddler/user.rb', line 20

def initialize(attributes={}) #:nodoc:
  a = attributes
  @username               = a['username']
  @first_name             = a['first_name']
  @last_name              = a['last_name']
  @about_me               = a['about_me']
  @avatar                 = a['avatar']
  @age                    = a['age'].to_i    
  @homepage               = a['homepage']
  @gender                 = a['gender']
  @company                = a['company']
  @city                   = a['city']
  @video_upload_count     = a['video_upload_count'].to_i
  @video_watch_count      = a['video_watch_count'].to_i
  @friend_count           = a['friend_count'].to_i
  @favourite_video_count  = a['favourite_video_count'].to_i
end

Instance Attribute Details

#about_meObject

Returns the value of attribute about_me.



5
6
7
# File 'lib/viddler/user.rb', line 5

def about_me
  @about_me
end

#ageObject

Returns the value of attribute age.



5
6
7
# File 'lib/viddler/user.rb', line 5

def age
  @age
end

#avatarObject

Returns the value of attribute avatar.



5
6
7
# File 'lib/viddler/user.rb', line 5

def avatar
  @avatar
end

#cityObject

Returns the value of attribute city.



5
6
7
# File 'lib/viddler/user.rb', line 5

def city
  @city
end

#companyObject

Returns the value of attribute company.



5
6
7
# File 'lib/viddler/user.rb', line 5

def company
  @company
end

#favourite_video_countObject

Returns the value of attribute favourite_video_count.



5
6
7
# File 'lib/viddler/user.rb', line 5

def favourite_video_count
  @favourite_video_count
end

#first_nameObject

Returns the value of attribute first_name.



5
6
7
# File 'lib/viddler/user.rb', line 5

def first_name
  @first_name
end

#friend_countObject

Returns the value of attribute friend_count.



5
6
7
# File 'lib/viddler/user.rb', line 5

def friend_count
  @friend_count
end

#genderObject

Returns the value of attribute gender.



5
6
7
# File 'lib/viddler/user.rb', line 5

def gender
  @gender
end

#homepageObject

Returns the value of attribute homepage.



5
6
7
# File 'lib/viddler/user.rb', line 5

def homepage
  @homepage
end

#last_nameObject

Returns the value of attribute last_name.



5
6
7
# File 'lib/viddler/user.rb', line 5

def last_name
  @last_name
end

#usernameObject

Returns the value of attribute username.



5
6
7
# File 'lib/viddler/user.rb', line 5

def username
  @username
end

#video_upload_countObject

Returns the value of attribute video_upload_count.



5
6
7
# File 'lib/viddler/user.rb', line 5

def video_upload_count
  @video_upload_count
end

#video_watch_countObject

Returns the value of attribute video_watch_count.



5
6
7
# File 'lib/viddler/user.rb', line 5

def video_watch_count
  @video_watch_count
end