Module: FbGraph::Connections::Roles

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

Instance Method Summary collapse

Instance Method Details

#admin!(user, options = {}) ⇒ Object



11
12
13
# File 'lib/fb_graph/connections/roles.rb', line 11

def admin!(user, options = {})
  role! user, options.merge(:role => 'administrators')
end

#developer!(user, options = {}) ⇒ Object



15
16
17
# File 'lib/fb_graph/connections/roles.rb', line 15

def developer!(user, options = {})
  role! user, options.merge(:role => 'developers')
end

#insights_user!(user, options = {}) ⇒ Object



23
24
25
# File 'lib/fb_graph/connections/roles.rb', line 23

def insights_user!(user, options = {})
  role! user, options.merge(:role => 'insights users')
end

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



27
28
29
# File 'lib/fb_graph/connections/roles.rb', line 27

def role!(user, options = {})
  post options.merge(:user => user.identifier, :connection => :roles)
end

#roles(options = {}) ⇒ Object



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

def roles(options = {})
  roles = self.connection :roles, options
  roles.map! do |role|
    Role.new role
  end
end

#tester!(user, options = {}) ⇒ Object



19
20
21
# File 'lib/fb_graph/connections/roles.rb', line 19

def tester!(user, options = {})
  role! user, options.merge(:role => 'testers')
end

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



31
32
33
# File 'lib/fb_graph/connections/roles.rb', line 31

def unrole!(user, options = {})
  delete options.merge(:user => user.identifier, :connection => :roles)
end