Class: WindowsError::HResult::HResultCode
- Defined in:
- lib/windows_error/h_result.rb
Overview
This class extends the ErrorCode with additional HRESULT-specific attributes.
Instance Attribute Summary
Attributes inherited from ErrorCode
Instance Method Summary collapse
-
#code ⇒ Integer
The error code.
-
#customer? ⇒ Boolean
Whether or not the value is customer-defined.
-
#facility ⇒ Facility::FacilityCode
The source of the error.
-
#failure? ⇒ Boolean
Whether or not the value indicates a failure.
-
#success? ⇒ Boolean
Whether or not the value indicates a succcess.
Methods inherited from ErrorCode
Constructor Details
This class inherits a constructor from WindowsError::ErrorCode
Instance Method Details
#code ⇒ Integer
Returns The error code.
32 33 34 |
# File 'lib/windows_error/h_result.rb', line 32 def code value & 0xffff end |
#customer? ⇒ Boolean
Returns Whether or not the value is customer-defined.
37 38 39 |
# File 'lib/windows_error/h_result.rb', line 37 def customer? value >> 29 == 1 end |
#facility ⇒ Facility::FacilityCode
Returns The source of the error.
42 43 44 |
# File 'lib/windows_error/h_result.rb', line 42 def facility Facility.find_by_code(value >> 16 & 0b11111) end |
#failure? ⇒ Boolean
Returns Whether or not the value indicates a failure.
47 48 49 |
# File 'lib/windows_error/h_result.rb', line 47 def failure? value >> 31 == 1 end |
#success? ⇒ Boolean
Returns Whether or not the value indicates a succcess.
52 53 54 |
# File 'lib/windows_error/h_result.rb', line 52 def success? !failure? end |