Module: FbGraph::Connections::Achievements

Included in:
Application
Defined in:
lib/fb_graph/connections/achievements.rb

Instance Method Summary collapse

Instance Method Details

#achievement!(achievement_url, options = {}) ⇒ Object



12
13
14
# File 'lib/fb_graph/connections/achievements.rb', line 12

def achievement!(achievement_url, options = {})
  post options.merge(:connection => :achievements, :achievement => achievement_url)
end

#achievements(options = {}) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/fb_graph/connections/achievements.rb', line 4

def achievements(options = {})
  options[:access_token] ||= self.access_token
  achievements = self.connection :achievements, options
  achievements.map! do |achievement|
    Achievement.new achievement[:id], achievement.merge(:access_token => options[:access_token])
  end
end

#unregister_achievement!(achievement_url, options = {}) ⇒ Object



16
17
18
# File 'lib/fb_graph/connections/achievements.rb', line 16

def unregister_achievement!(achievement_url, options = {})
  delete options.merge(:connection => :achievements, :achievement => achievement_url)
end