Module: Weechat::Callbacks
Class Attribute Summary (collapse)
-
+ (Object) callbacks
readonly
Returns the value of attribute callbacks.
-
+ (Object) unique_id
readonly
Returns the value of attribute unique_id.
Class Method Summary (collapse)
Instance Method Summary (collapse)
- - (Object) call_callback(id, type, *args)
- - (Object) callbacks
- - (Object) compute_free_id
- - (Object) register_callback(args = {})
- - (Object) unique_id
Class Attribute Details
+ (Object) callbacks (readonly)
Returns the value of attribute callbacks
7 8 9 |
# File 'lib/weechat/callbacks.rb', line 7 def callbacks @callbacks end |
+ (Object) unique_id (readonly)
Returns the value of attribute unique_id
8 9 10 |
# File 'lib/weechat/callbacks.rb', line 8 def unique_id @unique_id end |
Class Method Details
+ (Object) compute_free_id
10 11 12 |
# File 'lib/weechat/callbacks.rb', line 10 def compute_free_id @unique_id += 1 end |
Instance Method Details
- (Object) call_callback(id, type, *args)
15 16 17 |
# File 'lib/weechat/callbacks.rb', line 15 def call_callback(id, type, *args) return callbacks[id.to_i][type].call(*args) end |
- (Object) callbacks
27 28 29 |
# File 'lib/weechat/callbacks.rb', line 27 def callbacks Callbacks.callbacks end |
- (Object) compute_free_id
23 24 25 |
# File 'lib/weechat/callbacks.rb', line 23 def compute_free_id Callbacks.compute_free_id end |
- (Object) register_callback(args = {})
19 20 21 |
# File 'lib/weechat/callbacks.rb', line 19 def register_callback(args = {}) callbacks[unique_id] = args end |
- (Object) unique_id
31 32 33 |
# File 'lib/weechat/callbacks.rb', line 31 def unique_id Callbacks.unique_id end |