class

Bus::Handler

Inherits Reference < Object

Constructors

new(bus : Bus | Nil = nil, tags : Array(String) = [] of String, force : Bool | Nil = nil)
Source

Instance methods

authorized_to_handle?(msg)

Override this if only certain users should be authorized to have access to the given handler.

Source
can_handle?(msg)

This should probably be overridden in subclasses so that they can make informed decisions about whether or not they can handle the message.

Source
evaluate(msg : Bus::Message)

All implementations of

Source
evaluated_count

Return the number of times that this handler has evaluated a message.

Source
handle(msg : Bus::Message)
Source
handled_count

Return the number of times that this handler has handled a message.

Source
listen
Source
subscribe(bus : Bus)
Source
will_handle?(msg)

This method determines if the handler will handle the message. It checks #can_handle? to see if the handler is able to handle the message, and #authorized_to_handle? to see if the handler has permission to handle the message.

Source