Class: Weechat::Callback

Inherits:
Object
  • Object
show all
Defined in:
lib/weechat/callback.rb

Instance Method Summary collapse

Constructor Details

#initialize(callback) ⇒ Callback

Returns a new instance of Callback



3
4
5
# File 'lib/weechat/callback.rb', line 3

def initialize(callback)
  @callback = callback
end

Instance Method Details

#call(*args) ⇒ Object



7
8
9
# File 'lib/weechat/callback.rb', line 7

def call(*args)
  return Weechat::Utilities.safe_call {@callback.call(*args)}
end