Module: FbGraph::Connections::Permissions
- Included in:
- User
- Defined in:
- lib/fb_graph/connections/permissions.rb
Instance Method Summary collapse
Instance Method Details
#permissions(options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/fb_graph/connections/permissions.rb', line 4 def ( = {}) if FbGraph.v2? self.connection(:permissions, ).try(:inject, []) do |arr, entry| arr << entry[:permission].to_sym if entry[:status] == 'granted' arr end || [] else self.connection(:permissions, ).first.try(:inject, []) do |arr, (key, value)| arr << key.to_sym if value.to_i == 1 arr end || [] end end |
#revoke!(permission = nil, options = {}) ⇒ Object
18 19 20 |
# File 'lib/fb_graph/connections/permissions.rb', line 18 def revoke!( = nil, = {}) destroy .merge(:permission => , :connection => :permissions) end |