lib/httpx/callbacks.rb in httpx-0.23.4 vs lib/httpx/callbacks.rb in httpx-0.24.0
- old
+ new
@@ -2,16 +2,18 @@
module HTTPX
module Callbacks
def on(type, &action)
callbacks(type) << action
+ self
end
def once(type, &block)
on(type) do |*args, &callback|
block.call(*args, &callback)
:delete
end
+ self
end
def only(type, &block)
callbacks(type).clear
on(type, &block)