Exception: Ftdi::StatusCodeError

Inherits:
Error
  • Object
show all
Defined in:
lib/ftdi.rb

Overview

Represents error of libftdi with its status code.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_code, message) ⇒ StatusCodeError

Returns a new instance of StatusCodeError



65
66
67
68
# File 'lib/ftdi.rb', line 65

def initialize(status_code, message)
  super(message)
  @status_code = status_code
end

Instance Attribute Details

#status_codeFixnum (readonly)

Gets status code.

Returns:

  • (Fixnum)

    Status code.



63
64
65
# File 'lib/ftdi.rb', line 63

def status_code
  @status_code
end

Instance Method Details

#to_sString

Gets string representation of the error.

Returns:

  • (String)

    Representation of the error.



72
73
74
# File 'lib/ftdi.rb', line 72

def to_s
  "#{status_code}: #{super}"
end