lib/httpx/callbacks.rb in httpx-0.22.4 vs lib/httpx/callbacks.rb in httpx-0.22.5
- old
+ new
@@ -20,14 +20,14 @@
def emit(type, *args)
callbacks(type).delete_if { |pr| :delete == pr.call(*args) } # rubocop:disable Style/YodaCondition
end
- protected
-
def callbacks_for?(type)
- @callbacks.key?(type) && !@callbacks[type].empty?
+ @callbacks.key?(type) && @callbacks[type].any?
end
+
+ protected
def callbacks(type = nil)
return @callbacks unless type
@callbacks ||= Hash.new { |h, k| h[k] = [] }