Class: Discordrb::Events::PlayingEventHandler
- Inherits:
-
EventHandler
- Object
- EventHandler
- Discordrb::Events::PlayingEventHandler
- Defined in:
- lib/discordrb/events/presence.rb
Overview
Event handler for PlayingEvent
Instance Method Summary collapse
Methods inherited from EventHandler
#call, #initialize, #match, #matches_all
Constructor Details
This class inherits a constructor from Discordrb::Events::EventHandler
Instance Method Details
#matches?(event) ⇒ Boolean
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/discordrb/events/presence.rb', line 62 def matches?(event) # Check for the proper event type return false unless event.is_a? [ matches_all(@attributes[:from], event.user) do |a, e| if a.is_a? String a == e.name elsif a.is_a? Fixnum a == e.id else a == e end end, matches_all(@attributes[:game], event.game) do |a, e| if a.is_a? String a == e.name else a == e end end ].reduce(true, &:&) end |