Module: FbGraph2::Edge::Banned

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

Instance Method Summary collapse

Instance Method Details

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



16
17
18
19
20
# File 'lib/fb_graph2/edge/banned.rb', line 16

def ban!(user, params = {})
  self.post params.merge(
    uid: Util.as_identifier(user)
  ), edge: :banned
end

#banned(params = {}) ⇒ Object



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

def banned(params = {})
  users = self.edge :banned, params
  users.collect! do |user|
    User.new(user[:id], user).authenticate self.access_token
  end
end

#banned?(user, params = {}) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
# File 'lib/fb_graph2/edge/banned.rb', line 11

def banned?(user, params = {})
  users = self.edge :banned, params, edge_scope: user
  users.present?
end

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



22
23
24
25
26
# File 'lib/fb_graph2/edge/banned.rb', line 22

def unban!(user, params = {})
  self.delete params.merge(
    uid: Util.as_identifier(user)
  ), edge: :banned
end