Module: SC2Achievements

Defined in:
lib/sc2_achievements.rb,
lib/sc2_achievements/page.rb,
lib/sc2_achievements/homepage.rb,
lib/sc2_achievements/category_page.rb

Defined Under Namespace

Classes: CategoryPage, Homepage, Page

Class Method Summary collapse

Class Method Details

.for(user_path) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/sc2_achievements.rb', line 5

def self.for(user_path)
  achievements = get_achievements_for user_path
  achievements.sort_by do |title, achievement|
    [achievement[:date], -(achievement[:recentness] || 7)]
  end.reverse.collect do |title, achievement|
    achievement.delete :recentness
    achievement
  end
end