Class: Qpid::Proton::Types::Type
- Inherits:
-
Object
- Object
- Qpid::Proton::Types::Type
- Defined in:
- lib/types/type.rb
Overview
Represents an AMQP Type
Instance Attribute Summary collapse
- #code ⇒ Object readonly
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(x) ⇒ Object
- #hash ⇒ Object
- #name ⇒ Object (also: #to_s)
Instance Attribute Details
#code ⇒ Object (readonly)
33 34 35 |
# File 'lib/types/type.rb', line 33 def code @code end |
Class Method Details
.[](code) ⇒ Object
31 |
# File 'lib/types/type.rb', line 31 def self.[](code) try_convert(code) or raise IndexError, "unknown type code #{code}"; end |
.try_convert(code) ⇒ Object
30 |
# File 'lib/types/type.rb', line 30 def self.try_convert(code) code.is_a?(Type) ? code : @@builtin[code]; end |
Instance Method Details
#<=>(x) ⇒ Object
36 |
# File 'lib/types/type.rb', line 36 def <=>(x) @code <=> x; end |
#hash ⇒ Object
37 |
# File 'lib/types/type.rb', line 37 def hash() @code.hash; end |
#name ⇒ Object Also known as: to_s
34 |
# File 'lib/types/type.rb', line 34 def name() Cproton.pn_type_name(@code); end |