Class: SC2Achievements::Page
- Inherits:
-
Object
- Object
- SC2Achievements::Page
- Defined in:
- lib/sc2_achievements/page.rb
Direct Known Subclasses
Class Method Summary collapse
- .get_achievements_for(user_path, options = {}) ⇒ Object
- .get_categories_for(user_path, options = {}) ⇒ Object
Class Method Details
.get_achievements_for(user_path, options = {}) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/sc2_achievements/page.rb', line 11 def self.get_achievements_for(user_path, = {}) if .has_key? :category CategoryPage.get_achievements_for user_path, [:category] else Homepage.get_achievements_for user_path end end |
.get_categories_for(user_path, options = {}) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/sc2_achievements/page.rb', line 19 def self.get_categories_for(user_path, = {}) page = fetch_page_of user_path, page.css('#profile-menu a[href*=category]').collect do |achievement| achievement.attr('href')[/category\/(.*)/, 1] end end |