Class: Tuiter::UserExtended
- Defined in:
- lib/tuiter/data/user.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#favourites_count ⇒ Object
Returns the value of attribute favourites_count.
-
#following ⇒ Object
Returns the value of attribute following.
-
#friends_count ⇒ Object
Returns the value of attribute friends_count.
-
#notifications ⇒ Object
Returns the value of attribute notifications.
-
#profile_background_color ⇒ Object
Returns the value of attribute profile_background_color.
-
#profile_background_image_url ⇒ Object
Returns the value of attribute profile_background_image_url.
-
#profile_background_tile ⇒ Object
Returns the value of attribute profile_background_tile.
-
#profile_link_color ⇒ Object
Returns the value of attribute profile_link_color.
-
#profile_sidebar_border_color ⇒ Object
Returns the value of attribute profile_sidebar_border_color.
-
#profile_sidebar_fill_color ⇒ Object
Returns the value of attribute profile_sidebar_fill_color.
-
#profile_text_color ⇒ Object
Returns the value of attribute profile_text_color.
-
#statuses_count ⇒ Object
Returns the value of attribute statuses_count.
-
#time_zone ⇒ Object
Returns the value of attribute time_zone.
-
#utc_offset ⇒ Object
Returns the value of attribute utc_offset.
Attributes inherited from UserBasic
#description, #followers_count, #id, #location, #name, #profile_image_url, #protected, #screen_name, #url
Instance Method Summary collapse
-
#initialize(data = nil) ⇒ UserExtended
constructor
A new instance of UserExtended.
Constructor Details
#initialize(data = nil) ⇒ UserExtended
Returns a new instance of UserExtended.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/tuiter/data/user.rb', line 47 def initialize(data = nil) unless data.nil? super(data) @profile_background_color = data["profile_background_color"] @profile_text_color = data["profile_text_color"] @profile_link_color = data["profile_link_color"] @profile_sidebar_fill_color = data["profile_sidebar_fill_color"] @profile_sidebar_border_color = data["profile_sidebar_border_color"] @friends_count = data["friends_count"].to_i @created_at = (data["created_at"] ? DateTime.parse(data["created_at"]) : DateTime.now) @favourites_count = data["favourites_count"].to_i @utc_offset = data["utc_offset"] @time_zone = data["time_zone"] @profile_background_image_url = data["profile_background_image_url"] @profile_background_tile = data["profile_background_tile"] @following = data["following"] @notifications = data["notifications"] @statuses_count = data["statuses_count"].to_i else @created_at = DateTime.now end end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
37 38 39 |
# File 'lib/tuiter/data/user.rb', line 37 def created_at @created_at end |
#favourites_count ⇒ Object
Returns the value of attribute favourites_count.
38 39 40 |
# File 'lib/tuiter/data/user.rb', line 38 def favourites_count @favourites_count end |
#following ⇒ Object
Returns the value of attribute following.
43 44 45 |
# File 'lib/tuiter/data/user.rb', line 43 def following @following end |
#friends_count ⇒ Object
Returns the value of attribute friends_count.
36 37 38 |
# File 'lib/tuiter/data/user.rb', line 36 def friends_count @friends_count end |
#notifications ⇒ Object
Returns the value of attribute notifications.
44 45 46 |
# File 'lib/tuiter/data/user.rb', line 44 def notifications @notifications end |
#profile_background_color ⇒ Object
Returns the value of attribute profile_background_color.
31 32 33 |
# File 'lib/tuiter/data/user.rb', line 31 def profile_background_color @profile_background_color end |
#profile_background_image_url ⇒ Object
Returns the value of attribute profile_background_image_url.
41 42 43 |
# File 'lib/tuiter/data/user.rb', line 41 def profile_background_image_url @profile_background_image_url end |
#profile_background_tile ⇒ Object
Returns the value of attribute profile_background_tile.
42 43 44 |
# File 'lib/tuiter/data/user.rb', line 42 def profile_background_tile @profile_background_tile end |
#profile_link_color ⇒ Object
Returns the value of attribute profile_link_color.
33 34 35 |
# File 'lib/tuiter/data/user.rb', line 33 def profile_link_color @profile_link_color end |
#profile_sidebar_border_color ⇒ Object
Returns the value of attribute profile_sidebar_border_color.
35 36 37 |
# File 'lib/tuiter/data/user.rb', line 35 def @profile_sidebar_border_color end |
#profile_sidebar_fill_color ⇒ Object
Returns the value of attribute profile_sidebar_fill_color.
34 35 36 |
# File 'lib/tuiter/data/user.rb', line 34 def @profile_sidebar_fill_color end |
#profile_text_color ⇒ Object
Returns the value of attribute profile_text_color.
32 33 34 |
# File 'lib/tuiter/data/user.rb', line 32 def profile_text_color @profile_text_color end |
#statuses_count ⇒ Object
Returns the value of attribute statuses_count.
45 46 47 |
# File 'lib/tuiter/data/user.rb', line 45 def statuses_count @statuses_count end |
#time_zone ⇒ Object
Returns the value of attribute time_zone.
40 41 42 |
# File 'lib/tuiter/data/user.rb', line 40 def time_zone @time_zone end |
#utc_offset ⇒ Object
Returns the value of attribute utc_offset.
39 40 41 |
# File 'lib/tuiter/data/user.rb', line 39 def utc_offset @utc_offset end |