Module: Shortwave::Model::WeeklyCharts

Included in:
Group, User
Defined in:
lib/shortwave/model/weekly_charts.rb

Instance Method Summary collapse

Instance Method Details

#album_chartObject

Returns the most popular albums from this group for the last week



5
6
7
# File 'lib/shortwave/model/weekly_charts.rb', line 5

def album_chart
  link :weekly_album_chart, "Album", name
end

#artist_chartObject

Returns the most popular artists from this group for the last week



10
11
12
# File 'lib/shortwave/model/weekly_charts.rb', line 10

def artist_chart
  link :weekly_artist_chart, "Artist", name
end

#chart_datesObject

Returns an array of Time ranges, repesenting the weeks charts are available



20
21
22
# File 'lib/shortwave/model/weekly_charts.rb', line 20

def chart_dates
  @chart_dates ||= charts.map {|cd| cd.from..cd.to }.reverse
end

#track_chartObject

Returns the most popular tracks from this group for the last week



15
16
17
# File 'lib/shortwave/model/weekly_charts.rb', line 15

def track_chart
  link :weekly_track_chart, "Track", name
end