Class: Udb::ExceptionCode
- Inherits:
-
TopLevelDatabaseObject
- Object
- DatabaseObject
- TopLevelDatabaseObject
- Udb::ExceptionCode
- Extended by:
- T::Sig
- Includes:
- Comparable, Code
- Defined in:
- lib/udb/obj/exception_code.rb
Overview
a synchroncous exception code
Instance Method Summary collapse
- #<=>(other) ⇒ Integer?
-
#display_name ⇒ String
included
from Code
Long-form display name (can include special characters).
- #eql?(other) ⇒ Boolean
- #hash ⇒ Integer
-
#num ⇒ Integer
included
from Code
Code, written into *mcause.
- #validate(resolver)
-
#var ⇒ String
included
from Code
Field name for an IDL enum.
Constructor Details
This class inherits a constructor from Udb::TopLevelDatabaseObject
Instance Method Details
#<=>(other) ⇒ Integer?
49 50 51 52 53 |
# File 'lib/udb/obj/exception_code.rb', line 49 def <=>(other) return nil unless T.cast(other, Object).is_a?(ExceptionCode) num <=> T.cast(other, ExceptionCode).num end |
#display_name ⇒ String Originally defined in module Code
Returns Long-form display name (can include special characters).
#eql?(other) ⇒ Boolean
56 57 58 |
# File 'lib/udb/obj/exception_code.rb', line 56 def eql?(other) (self <=> other) == 0 end |
#hash ⇒ Integer
61 |
# File 'lib/udb/obj/exception_code.rb', line 61 def hash = [ExceptionCode, num].hash |
#num ⇒ Integer Originally defined in module Code
Returns Code, written into *mcause.
#validate(resolver)
This method returns an undefined value.
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/udb/obj/exception_code.rb', line 36 def validate(resolver) super(resolver) @arch.exception_codes.each do |code| next if code == self if num == code.num raise ValidationError, "Duplicate exception code #{num} for #{name}, #{code.name}" end end end |
#var ⇒ String Originally defined in module Code
Returns Field name for an IDL enum.