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

- (Error) initialize(msg = nil, transferred = nil)

A new instance of Error



37
38
39
40
# File 'lib/libusb/constants.rb', line 37

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

Instance Attribute Details

- (Fixnum, String) transferred (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



35
36
37
# File 'lib/libusb/constants.rb', line 35

def transferred
  @transferred
end