Class: LIBUSB::DevHandle::EMTransfer
- Inherits:
-
Object
- Object
- LIBUSB::DevHandle::EMTransfer
- Includes:
- EM::Deferrable
- Defined in:
- lib/libusb/eventmachine.rb
Instance Method Summary collapse
-
#initialize(opts, dev_handle, transfer_method) ⇒ EMTransfer
constructor
A new instance of EMTransfer.
Constructor Details
#initialize(opts, dev_handle, transfer_method) ⇒ EMTransfer
Returns a new instance of EMTransfer.
124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/libusb/eventmachine.rb', line 124 def initialize(opts, dev_handle, transfer_method) dev_handle.send(transfer_method, **opts) do |res| EM.next_tick do if res.kind_of?(LIBUSB::Error) fail res else succeed res end end end end |