lib/stripe_event.rb in stripe_event-2.3.0 vs lib/stripe_event.rb in stripe_event-2.3.1
- old
+ new
@@ -16,14 +16,16 @@
def instrument(event)
event = event_filter.call(event)
backend.instrument namespace.call(event.type), event if event
end
- def subscribe(name, callable = Proc.new)
+ def subscribe(name, callable = nil, &block)
+ callable ||= block
backend.subscribe namespace.to_regexp(name), adapter.call(callable)
end
- def all(callable = Proc.new)
+ def all(callable = nil, &block)
+ callable ||= block
subscribe nil, callable
end
def listening?(name)
namespaced_name = namespace.call(name)