Class: Discordrb::Events::ServerRoleDeleteEventHandler

Inherits:
EventHandler
  • Object
show all
Defined in:
lib/discordrb/events/roles.rb

Overview

EventHandler for ServerRoleDeleteEvent

Instance Method Summary collapse

Methods inherited from EventHandler

#after_call, #call, #initialize, #match, #matches_all

Constructor Details

This class inherits a constructor from Discordrb::Events::EventHandler

Instance Method Details

#matches?(event) ⇒ Boolean

Returns:

  • (Boolean)

66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/discordrb/events/roles.rb', line 66

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

  [
    matches_all(@attributes[:name], event.name) do |a, e|
      a == if a.is_a? String
             e.to_s
           else
             e
           end
    end
  ].reduce(true, &:&)
end