lib/ruboty/robot.rb in ruboty-1.0.4 vs lib/ruboty/robot.rb in ruboty-1.1.0
- old
+ new
@@ -22,11 +22,13 @@
adapt
end
def receive(attributes)
message = Message.new(attributes.merge(robot: self))
- handlers.each do |handler|
- handler.call(message)
+ unless handlers.inject(false) { |matched, handler| matched | handler.call(message) }
+ handlers.each do |handler|
+ handler.call(message, missing: true)
+ end
end
end
# ROBOT_NAME is deprecated.
def name