Class: Discordrb::Events::GuildRoleUpdateEventHandler

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

Overview

Event handler for GuildRoleUpdateEvent

Instance Method Summary collapse

Methods inherited from EventHandler

#initialize, #match, #matches_all

Constructor Details

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

Instance Method Details

#matches?(event) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/discordrb/events/guild_role_update.rb', line 21

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

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