lib/lita/handler/event_router.rb in lita-4.0.0.rc1 vs lib/lita/handler/event_router.rb in lita-4.0.0.rc2
- old
+ new
@@ -54,12 +54,12 @@
# @param robot [Lita::Robot] The currently running robot instance.
# @param event_name [String, Symbol], The name of the event to trigger.
# @param payload [Hash] An optional hash of arbitrary data.
# @return [Boolean] Whether or not the event triggered any callbacks.
def trigger(robot, event_name, payload = {})
- event_subscriptions_for(event_name).any? do |callback|
+ event_subscriptions_for(event_name).map do |callback|
callback.call(new(robot), payload)
- end
+ end.any?
end
private
# A hash of arrays used to store event subscriptions registered with {#on}.