Class: Shortwave::Model::User

Inherits:
BaseModel show all
Includes:
WeeklyCharts
Defined in:
lib/shortwave/model/user.rb

Instance Method Summary collapse

Methods included from WeeklyCharts

#album_chart, #artist_chart, #chart_dates, #track_chart

Methods inherited from BaseModel

facade_name, identified_by, inherited, link_to, #session=, sharable, shoutable, taggable

Instance Method Details

#compare_with(other_user) ⇒ Object



65
66
67
# File 'lib/shortwave/model/user.rb', line 65

def compare_with(other_user)
  Comparison.parse(@session.tasteometer_facacde.compare("user", "user", name, other_user.name), :single => true)
end

#eventsObject

Returns the events that this user is attending.



21
22
23
# File 'lib/shortwave/model/user.rb', line 21

def events
  link :events, :Event, name
end

#friendsObject

Returns the first 50 of a user’s friends on Last.fm



46
47
48
# File 'lib/shortwave/model/user.rb', line 46

def friends
  link :friends, :User, name
end

#loved_tracksObject

Returns tracks a user has “loved”.



36
37
38
# File 'lib/shortwave/model/user.rb', line 36

def loved_tracks
  link :loved_tracks, :Track, name
end

#neighboursObject

Returns other Last.fm users with similar taste to this user.



41
42
43
# File 'lib/shortwave/model/user.rb', line 41

def neighbours
  link :neighbours, :User, name
end

#past_eventsObject

Returns the events a user has attended.



26
27
28
# File 'lib/shortwave/model/user.rb', line 26

def past_events
  link :past_events, :Event, name
end

#playlistsObject

Returns a user’s playlists



51
52
53
# File 'lib/shortwave/model/user.rb', line 51

def playlists
  link :playlists, :Playlist, name
end

#recent_tracksObject

Returns the recent tracks played by this user.



31
32
33
# File 'lib/shortwave/model/user.rb', line 31

def recent_tracks
  link :recent_tracks, :Track, name
end

Returns the first 50 artists this user may be interested in.



61
62
63
# File 'lib/shortwave/model/user.rb', line 61

def recommended_artists
  link :recommended_artists, :Artist
end

Returns events this user may be interested in.



56
57
58
# File 'lib/shortwave/model/user.rb', line 56

def recommended_events
  link :recommended_events, :Event
end