Module: FFI::Libfuse::Callbacks
- Included in:
- FuseCallbacks
- Defined in:
- lib/ffi/libfuse/callbacks.rb
Overview
Methods to register callbacks and wrappers
Instance Method Summary collapse
-
#register(method, wrappers = [], &block) ⇒ Object
Registers block as a callback method.
Instance Method Details
#register(method, wrappers = [], &block) ⇒ Object
Note:
wrappers are defined in inside out order
Registers block as a callback method
27 28 29 30 31 32 33 34 |
# File 'lib/ffi/libfuse/callbacks.rb', line 27 def register(method, wrappers = [], &block) callback = wrappers.each.inject(block) do |b, w| next wrap_callback(method, **w, &b) if w.is_a?(Hash) wrap_callback(method, w, &b) end send(:[]=, method, callback) end |