Class: Rubycord::Events::AwaitEventHandler
- Inherits:
-
EventHandler
- Object
- EventHandler
- Rubycord::Events::AwaitEventHandler
- Defined in:
- lib/rubycord/events/await.rb
Overview
Event handler for AwaitEvent
Instance Method Summary collapse
Methods inherited from EventHandler
#after_call, #call, #initialize, #match, #matches_all
Constructor Details
This class inherits a constructor from Rubycord::Events::EventHandler
Instance Method Details
#matches?(event) ⇒ Boolean
36 37 38 39 40 41 42 43 44 |
# File 'lib/rubycord/events/await.rb', line 36 def matches?(event) # Check for the proper event type return false unless event.is_a? AwaitEvent [ matches_all(@attributes[:key], event.key) { |a, e| a == e }, matches_all(@attributes[:type], event.type) { |a, e| a == e } ].reduce(true, &:&) end |