lib/protocol/http/middleware.rb in protocol-http-0.16.3 vs lib/protocol/http/middleware.rb in protocol-http-0.17.0

- old
+ new

@@ -26,9 +26,17 @@ require_relative 'response' module Protocol module HTTP class Middleware < Methods + # Convert a block to a middleware delegate. + def self.for(&block) + def block.close + end + + return self.new(block) + end + def initialize(delegate) @delegate = delegate end attr :delegate