Class: WindowsError::HResult::Facility::FacilityCode
- Inherits:
-
Struct
- Object
- Struct
- WindowsError::HResult::Facility::FacilityCode
- Defined in:
- lib/windows_error/h_result/facility.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other_object) ⇒ Object (also: #===)
- #to_s ⇒ Object
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description
7 8 9 |
# File 'lib/windows_error/h_result/facility.rb', line 7 def description @description end |
#name ⇒ Object
Returns the value of attribute name
7 8 9 |
# File 'lib/windows_error/h_result/facility.rb', line 7 def name @name end |
#value ⇒ Object
Returns the value of attribute value
7 8 9 |
# File 'lib/windows_error/h_result/facility.rb', line 7 def value @value end |
Instance Method Details
#==(other_object) ⇒ Object Also known as: ===
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/windows_error/h_result/facility.rb', line 8 def ==(other_object) if other_object.kind_of? self.class self.value == other_object.value elsif other_object.kind_of? Integer self.value == other_object elsif other_object.nil? false else raise ArgumentError, "Cannot compare a #{self.class} to a #{other_object.class}" end end |
#to_s ⇒ Object
22 23 24 25 |
# File 'lib/windows_error/h_result/facility.rb', line 22 def to_s code = sprintf "%04x", self.value "(0x#{code}) #{self.name}: #{self.description}" end |