Module: FbGraph2::Edge::Blocked

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

Instance Method Summary collapse

Instance Method Details

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



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

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

#blocked(params = {}) ⇒ Object



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

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

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

Returns:

  • (Boolean)


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

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

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



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

def unblock!(user, params = {})
  self.delete params.merge(
    user: Util.as_identifier(user)
  ), edge: :blocked
end