Class: EMJack::Handler::Deleted

Inherits:
Object
  • Object
show all
Defined in:
lib/em-jack/handlers/deleted.rb

Constant Summary collapse

RESPONSE =
/^DELETED\r\n/

Class Method Summary collapse

Class Method Details

.handle(deferrable, response, body, conn = nil) ⇒ Object



10
11
12
13
14
15
# File 'lib/em-jack/handlers/deleted.rb', line 10

def self.handle(deferrable, response, body, conn=nil)
  return false unless response =~ RESPONSE

  deferrable.succeed
  true
end

.handles?(response) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/em-jack/handlers/deleted.rb', line 6

def self.handles?(response)
  response =~ RESPONSE
end