Exception: LIBUSB::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/libusb/constants.rb

Overview

Base class of libusb errors

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg = nil, transferred = nil) ⇒ Error

Returns a new instance of Error.


49
50
51
52
# File 'lib/libusb/constants.rb', line 49

def initialize(msg=nil, transferred=nil)
  super(msg)
  @transferred = transferred
end

Instance Attribute Details

#transferredFixnum, String (readonly)

The data already transferred before the exception was raised

Returns:

  • (Fixnum)

    Number of bytes sent for an outgoing transfer

  • (String)

    Received data for an ingoing transfer


47
48
49
# File 'lib/libusb/constants.rb', line 47

def transferred
  @transferred
end