Class: OnyxCord::Events::ServerRoleDeleteEventHandler

Inherits:
EventHandler
  • Object
show all
Defined in:
lib/onyxcord/events/role/delete.rb

Overview

EventHandler for ServerRoleDeleteEvent

Instance Method Summary collapse

Methods inherited from EventHandler

#after_call, #call, #match, #matches_all

Instance Method Details

#matches?(event) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
32
33
34
35
36
37
38
# File 'lib/onyxcord/events/role/delete.rb', line 29

def matches?(event)
  # Check for the proper event type
  return false unless event.is_a? ServerRoleDeleteEvent

  [
    matches_all(@attributes[:id], event.id) do |a, e|
      a.resolve_id == e.resolve_id
    end
  ].reduce(true, &:&)
end