Class: LastfmItunes::Lastfm::User
- Inherits:
-
Object
- Object
- LastfmItunes::Lastfm::User
- Includes:
- Tracks
- Defined in:
- lib/lastfm-itunes/lastfm/user.rb
Instance Attribute Summary collapse
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ User
constructor
A new instance of User.
- #my_top_tracks(other_tracks) {|tracks.size| ... } ⇒ Object
- #top_tracks ⇒ Object
Methods included from Tracks
#find, #group_tracks_by_artist, #intersection_of_tracks, #over_limit?
Constructor Details
Instance Attribute Details
#limit ⇒ Object
Returns the value of attribute limit.
4 5 6 |
# File 'lib/lastfm-itunes/lastfm/user.rb', line 4 def limit @limit end |
#user ⇒ Object
Returns the value of attribute user.
4 5 6 |
# File 'lib/lastfm-itunes/lastfm/user.rb', line 4 def user @user end |
Instance Method Details
#my_top_tracks(other_tracks) {|tracks.size| ... } ⇒ Object
11 12 13 14 15 |
# File 'lib/lastfm-itunes/lastfm/user.rb', line 11 def my_top_tracks(other_tracks, &block) tracks = top_tracks yield tracks.size if block_given? intersection_of_tracks(tracks, other_tracks) end |
#top_tracks ⇒ Object
17 18 19 |
# File 'lib/lastfm-itunes/lastfm/user.rb', line 17 def top_tracks user.top_tracks(false, @limit) end |