Class: Event

Inherits:
Object
  • Object
show all
Defined in:
lib/advanced_ruby_command_handler/event.rb

Instance Method Summary collapse

Constructor Details

#initialize(event, client, &block) ⇒ Event

Returns a new instance of Event.



4
5
6
7
8
# File 'lib/advanced_ruby_command_handler/event.rb', line 4

def initialize(event, client, &block)
  return unless client.methods.include?(event)

  client.method(event).call { |e| block.call(e) }
end