Sha256: ccf65318b5ac71add22da7a45a2ee24dde33e5e796abae71d06cbe8a6f276349
Contents?: true
Size: 666 Bytes
Versions: 3
Compression:
Stored size: 666 Bytes
Contents
module FbGraph module Connections module Permissions def permissions(options = {}) self.connection(:permissions, options).try(:inject, []) do |arr, entry| if entry.include? :status # v2.0 arr << entry[:permission].to_sym if entry[:status] == 'granted' else # v1.0 entry.each do |key, value| arr << key.to_sym if value.to_i == 1 end end arr end || [] end def revoke!(permission = nil, options = {}) destroy options.merge(:permission => permission, :connection => :permissions) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
fb_graph-2.7.17 | lib/fb_graph/connections/permissions.rb |
fb_graph-2.7.16 | lib/fb_graph/connections/permissions.rb |
fb_graph-2.7.15 | lib/fb_graph/connections/permissions.rb |