Sha256: 58b9cf32aa2fc1348b8f786598140f219fd78577940dc42c0dbfdf735bf5c9e3

Contents?: true

Size: 440 Bytes

Versions: 2

Compression:

Stored size: 440 Bytes

Contents

module EMJack
  module Handler
    class NotIgnored
      RESPONSE = /^NOT_IGNORED\r\n/

      def self.handles?(response)
        response =~ RESPONSE
      end
      
      def self.handle(deferrable, response, body)
        return false unless response =~ RESPONSE

        deferrable.fail("Can't ignore only watched tube")
        true
      end

      EMJack::Connection.register_handler(EMJack::Handler::NotIgnored)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
em-jack-0.0.6 lib/em-jack/handlers/not_ignored.rb
em-jack-0.0.5 lib/em-jack/handlers/not_ignored.rb