Module: GSGraph::Connections::UserAchievements
- Included in:
- User
- Defined in:
- lib/gs_graph/connections/user_achievements.rb
Instance Method Summary collapse
- #achieve!(achievement_url, options = {}) ⇒ Object
- #achievements(options = {}) ⇒ Object
- #unachieve!(achievement_url, options = {}) ⇒ Object
Instance Method Details
#achieve!(achievement_url, options = {}) ⇒ Object
12 13 14 15 |
# File 'lib/gs_graph/connections/user_achievements.rb', line 12 def achieve!(achievement_url, = {}) achievement = post .merge(:connection => :achievements, :achievement => achievement_url) UserAchievement.new achievement[:id], achievement end |
#achievements(options = {}) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/gs_graph/connections/user_achievements.rb', line 4 def achievements( = {}) [:access_token] ||= self.access_token achievements = self.connection :achievements, achievements.map! do |achievement| UserAchievement.new achievement[:id], achievement.merge(:access_token => [:access_token]) end end |
#unachieve!(achievement_url, options = {}) ⇒ Object
17 18 19 |
# File 'lib/gs_graph/connections/user_achievements.rb', line 17 def unachieve!(achievement_url, = {}) delete .merge(:connection => :achievements, :achievement => achievement_url) end |