Class: Rooibos::Router::Predicate::Events
- Inherits:
-
Object
- Object
- Rooibos::Router::Predicate::Events
- Defined in:
- lib/rooibos/router/predicate.rb
Overview
Matches key events by symbol.
Instance Method Summary collapse
- #arity ⇒ Object
- #call(message, _model) ⇒ Object
-
#initialize(keys:) ⇒ Events
constructor
A new instance of Events.
Constructor Details
#initialize(keys:) ⇒ Events
Returns a new instance of Events.
15 16 17 |
# File 'lib/rooibos/router/predicate.rb', line 15 def initialize(keys:) super(keys: Array(keys)) end |
Instance Method Details
#arity ⇒ Object
19 |
# File 'lib/rooibos/router/predicate.rb', line 19 def arity = 2 |
#call(message, _model) ⇒ Object
21 22 23 |
# File 'lib/rooibos/router/predicate.rb', line 21 def call(, _model) .respond_to?(:to_sym) && keys.include?(.to_sym) end |