Sha256: 779e046e3e51587303ef5e7d0042754a90fb8ab8cc8bd8e25c38548810f4a307

Contents?: true

Size: 785 Bytes

Versions: 16

Compression:

Stored size: 785 Bytes

Contents

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

      def achieve!(achievement_url, options = {})
        achievement = post options.merge(:connection => :achievements, :achievement => achievement_url)
        UserAchievement.new achievement[:id], achievement
      end

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
fb_graph-2.2.6 lib/fb_graph/connections/user_achievements.rb
fb_graph-2.2.5 lib/fb_graph/connections/user_achievements.rb
fb_graph-2.2.4 lib/fb_graph/connections/user_achievements.rb
fb_graph-2.2.3 lib/fb_graph/connections/user_achievements.rb
fb_graph-2.2.2 lib/fb_graph/connections/user_achievements.rb
fb_graph-2.2.1 lib/fb_graph/connections/user_achievements.rb
fb_graph-2.2.0 lib/fb_graph/connections/user_achievements.rb
fb_graph-2.2.0.beta lib/fb_graph/connections/user_achievements.rb
fb_graph-2.2.0.alpha2 lib/fb_graph/connections/user_achievements.rb
fb_graph-2.2.0.alpha lib/fb_graph/connections/user_achievements.rb
fb_graph-2.1.13 lib/fb_graph/connections/user_achievements.rb
fb_graph-2.1.12 lib/fb_graph/connections/user_achievements.rb
fb_graph-2.1.11 lib/fb_graph/connections/user_achievements.rb
fb_graph-2.1.10 lib/fb_graph/connections/user_achievements.rb
fb_graph-2.1.9 lib/fb_graph/connections/user_achievements.rb
fb_graph-2.1.8 lib/fb_graph/connections/user_achievements.rb