Module: GSGraph::Connections::Banned
- Included in:
- Application
- Defined in:
- lib/gs_graph/connections/banned.rb
Instance Method Summary collapse
- #ban!(*users) ⇒ Object
- #banned(options = {}) ⇒ Object
- #banned?(user, options = {}) ⇒ Boolean
- #unban!(user, options = {}) ⇒ Object
Instance Method Details
#ban!(*users) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/gs_graph/connections/banned.rb', line 18 def ban!(*users) = users. post .merge( :connection => :banned, :uid => Array(users).flatten.collect(&:identifier).join(',') ) end |
#banned(options = {}) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/gs_graph/connections/banned.rb', line 4 def banned( = {}) banned = self.connection :banned, banned.map! do |user| User.new(user[:id], user.merge( :access_token => [:access_token] || self.access_token )) end end |
#banned?(user, options = {}) ⇒ Boolean
13 14 15 16 |
# File 'lib/gs_graph/connections/banned.rb', line 13 def banned?(user, = {}) banned = self.connection :banned, .merge(:connection_scope => user.identifier) banned.present? end |
#unban!(user, options = {}) ⇒ Object
26 27 28 |
# File 'lib/gs_graph/connections/banned.rb', line 26 def unban!(user, = {}) delete .merge(:connection => :banned, :connection_scope => user.identifier) end |