Exception: MIDICommunicationsWindows::Error
- Inherits:
-
StandardError
- Object
- StandardError
- MIDICommunicationsWindows::Error
- Defined in:
- lib/midi-communications-windows/api.rb
Overview
Raised when a WinMM call reports a failure.
WinMM reports errors as MMRESULT codes rather than by any out-of-band
mechanism, so every call is checked and a failure becomes an exception at
the point of the call, carrying the text WinMM itself gives for the code.
Instance Attribute Summary collapse
-
#code ⇒ Integer?
readonly
The
MMRESULTWinMM returned, or nil for a failure WinMM did not report as a code — a call that never completed, for instance. - #operation ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(operation, code, text = nil) ⇒ Error
constructor
private
A new instance of Error.
Constructor Details
#initialize(operation, code, text = nil) ⇒ Error
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Error.
22 23 24 25 26 27 |
# File 'lib/midi-communications-windows/api.rb', line 22 def initialize(operation, code, text = nil) @operation = operation @code = code super((operation, code, text)) end |
Instance Attribute Details
#code ⇒ Integer? (readonly)
Returns the MMRESULT WinMM returned, or nil for a
failure WinMM did not report as a code — a call that never completed,
for instance.
16 17 18 |
# File 'lib/midi-communications-windows/api.rb', line 16 def code @code end |
#operation ⇒ Object (readonly)
16 |
# File 'lib/midi-communications-windows/api.rb', line 16 attr_reader :code, :operation |