Class: Brute::Events::Handler
- Inherits:
-
Object
- Object
- Brute::Events::Handler
- Defined in:
- lib/brute/events/handler.rb
Overview
Stackable event handler base class. Subclasses override the append method, do their thing, then call super (or don’t, to swallow the event).
Direct Known Subclasses
Instance Method Summary collapse
-
#<<(event) ⇒ Object
Default: pass through.
-
#initialize(inner) ⇒ Handler
constructor
A new instance of Handler.
Constructor Details
#initialize(inner) ⇒ Handler
Returns a new instance of Handler.
13 14 15 |
# File 'lib/brute/events/handler.rb', line 13 def initialize(inner) @inner = inner end |
Instance Method Details
#<<(event) ⇒ Object
Default: pass through. Subclasses override this method, do their thing, then call super (or don’t, to swallow the event).
19 20 21 22 23 |
# File 'lib/brute/events/handler.rb', line 19 def <<(event) tap do @inner << event if @inner end end |