Module: FbGraph2::Edge::Roles::AppContext

Included in:
App
Defined in:
lib/fb_graph2/edge/roles.rb

Instance Method Summary collapse

Instance Method Details

#role!(user, params = {}) ⇒ Object



12
13
14
15
16
# File 'lib/fb_graph2/edge/roles.rb', line 12

def role!(user, params = {})
  self.post params.merge(
    user: Util.as_identifier(user)
  ), edge: :roles
end

#roles(params = {}) ⇒ Object



5
6
7
8
9
10
# File 'lib/fb_graph2/edge/roles.rb', line 5

def roles(params = {})
  roles = self.edge :roles, params
  roles.collect! do |role|
    Struct::Role.new role
  end
end

#unrole!(user, params = {}) ⇒ Object



18
19
20
21
22
# File 'lib/fb_graph2/edge/roles.rb', line 18

def unrole!(user, params = {})
  self.post params.merge(
    user: Util.as_identifier(user)
  ), edge: :roles
end