Class: SandthornSequelProjection::EventHandler
- Inherits:
-
Object
- Object
- SandthornSequelProjection::EventHandler
- Defined in:
- lib/sandthorn_sequel_projection/event_handler.rb
Instance Attribute Summary collapse
-
#filter ⇒ Object
readonly
Returns the value of attribute filter.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#projection ⇒ Object
readonly
Returns the value of attribute projection.
Instance Method Summary collapse
- #handle(target, event) ⇒ Object
-
#initialize(options) ⇒ EventHandler
constructor
A new instance of EventHandler.
Constructor Details
#initialize(options) ⇒ EventHandler
Returns a new instance of EventHandler.
6 7 8 9 |
# File 'lib/sandthorn_sequel_projection/event_handler.rb', line 6 def initialize() @filter = SandthornEventFilter::Filter.new () end |
Instance Attribute Details
#filter ⇒ Object (readonly)
Returns the value of attribute filter.
4 5 6 |
# File 'lib/sandthorn_sequel_projection/event_handler.rb', line 4 def filter @filter end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/sandthorn_sequel_projection/event_handler.rb', line 4 def @message end |
#projection ⇒ Object (readonly)
Returns the value of attribute projection.
4 5 6 |
# File 'lib/sandthorn_sequel_projection/event_handler.rb', line 4 def projection @projection end |
Instance Method Details
#handle(target, event) ⇒ Object
11 12 13 14 15 |
# File 'lib/sandthorn_sequel_projection/event_handler.rb', line 11 def handle(target, event) if filter.match?(event) call_handler(target, event) end end |