lib/messaging/routing/route.rb in messaging-3.5.2 vs lib/messaging/routing/route.rb in messaging-3.5.3
- old
+ new
@@ -9,10 +9,10 @@
attr_reader :matcher
attr_reader :handler
def initialize(pattern, handler)
@matcher = MessageMatcher.new(pattern: pattern)
- @handler = handler
+ @handler = handler.respond_to?(:to_proc) ? handler : handler.method(:call)
verify_handler!
end
def call(message, context = self)
return unless @matcher.matches?(message)