Class: Event
- Inherits:
-
Object
- Object
- Event
- Defined in:
- lib/advanced_ruby_command_handler/event.rb
Instance Method Summary collapse
-
#initialize(event, client, &block) ⇒ Event
constructor
A new instance of Event.
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 |