Module: FbGraph2::Edge::Roles::PageContext

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

Instance Method Summary collapse

Instance Method Details

#roles(*args) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/fb_graph2/edge/roles.rb', line 26

def roles(*args)
  params = args.extract_options!
  users = self.edge :roles, params, edge_scope: args.first
  users.collect! do |user|
    User.new(user[:id], user).authenticate self.access_token
  end
  if args.first.present?
    users.first
  else
    users
  end
end