Class: Hypem::User
Instance Attribute Summary collapse
-
#followed_items_count ⇒ Object
readonly
Returns the value of attribute followed_items_count.
-
#followed_queries_count ⇒ Object
readonly
Returns the value of attribute followed_queries_count.
-
#followed_sites_count ⇒ Object
readonly
Returns the value of attribute followed_sites_count.
-
#followed_users_count ⇒ Object
readonly
Returns the value of attribute followed_users_count.
-
#friends ⇒ Object
readonly
Returns the value of attribute friends.
-
#full_name ⇒ Object
readonly
Returns the value of attribute full_name.
-
#image_url ⇒ Object
readonly
Returns the value of attribute image_url.
-
#joined_at ⇒ Object
readonly
Returns the value of attribute joined_at.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#twitter_username ⇒ Object
readonly
Returns the value of attribute twitter_username.
Instance Method Summary collapse
- #favorite_blogs ⇒ Object
- #feed_playlist(page = 1) ⇒ Object
- #friends_favorites_playlist(page = 1) ⇒ Object
- #friends_history_playlist(page = 1) ⇒ Object
- #get_profile ⇒ Object
-
#initialize(name) ⇒ User
constructor
A new instance of User.
-
#loved_playlist(page = 1) ⇒ Object
playlist requests.
- #obsessed_playlist(page = 1) ⇒ Object
Methods included from Helper
included, #update_from_response
Constructor Details
#initialize(name) ⇒ User
Returns a new instance of User.
12 13 14 15 |
# File 'lib/hypem/user.rb', line 12 def initialize(name) raise ArgumentError unless name.is_a? String @name = name end |
Instance Attribute Details
#followed_items_count ⇒ Object (readonly)
Returns the value of attribute followed_items_count.
8 9 10 |
# File 'lib/hypem/user.rb', line 8 def followed_items_count @followed_items_count end |
#followed_queries_count ⇒ Object (readonly)
Returns the value of attribute followed_queries_count.
8 9 10 |
# File 'lib/hypem/user.rb', line 8 def followed_queries_count @followed_queries_count end |
#followed_sites_count ⇒ Object (readonly)
Returns the value of attribute followed_sites_count.
8 9 10 |
# File 'lib/hypem/user.rb', line 8 def followed_sites_count @followed_sites_count end |
#followed_users_count ⇒ Object (readonly)
Returns the value of attribute followed_users_count.
8 9 10 |
# File 'lib/hypem/user.rb', line 8 def followed_users_count @followed_users_count end |
#friends ⇒ Object (readonly)
Returns the value of attribute friends.
8 9 10 |
# File 'lib/hypem/user.rb', line 8 def friends @friends end |
#full_name ⇒ Object (readonly)
Returns the value of attribute full_name.
8 9 10 |
# File 'lib/hypem/user.rb', line 8 def full_name @full_name end |
#image_url ⇒ Object (readonly)
Returns the value of attribute image_url.
8 9 10 |
# File 'lib/hypem/user.rb', line 8 def image_url @image_url end |
#joined_at ⇒ Object (readonly)
Returns the value of attribute joined_at.
8 9 10 |
# File 'lib/hypem/user.rb', line 8 def joined_at @joined_at end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
8 9 10 |
# File 'lib/hypem/user.rb', line 8 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/hypem/user.rb', line 8 def name @name end |
#twitter_username ⇒ Object (readonly)
Returns the value of attribute twitter_username.
8 9 10 |
# File 'lib/hypem/user.rb', line 8 def twitter_username @twitter_username end |
Instance Method Details
#favorite_blogs ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/hypem/user.rb', line 24 def favorite_blogs response = get_resource('/get_favorite_blogs') response.map do |r| blog = Hypem::Blog.new(r['siteid']) blog.update_from_response(r) blog end end |
#feed_playlist(page = 1) ⇒ Object
54 55 56 |
# File 'lib/hypem/user.rb', line 54 def feed_playlist(page=1) @f_p ||= Playlist.feed(@name,page) end |
#friends_favorites_playlist(page = 1) ⇒ Object
58 59 60 |
# File 'lib/hypem/user.rb', line 58 def friends_favorites_playlist(page=1) @f_f_p ||= Playlist.friends_favorites(@name,page) end |
#friends_history_playlist(page = 1) ⇒ Object
62 63 64 |
# File 'lib/hypem/user.rb', line 62 def friends_history_playlist(page=1) @f_h_p ||= Playlist.friends_history(@name,page) end |
#get_profile ⇒ Object
17 18 19 20 21 22 |
# File 'lib/hypem/user.rb', line 17 def get_profile response = get_resource('/get_profile') flattened_response = flatten_response(response) update_from_response(flattened_response) self end |
#loved_playlist(page = 1) ⇒ Object
playlist requests
46 47 48 |
# File 'lib/hypem/user.rb', line 46 def loved_playlist(page=1) @l_p ||= Playlist.loved(@name,page) end |
#obsessed_playlist(page = 1) ⇒ Object
50 51 52 |
# File 'lib/hypem/user.rb', line 50 def obsessed_playlist(page=1) @o_p ||= Playlist.obsessed(@name,page) end |