Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/types/array.rb
Instance Attribute Summary collapse
-
#proton_array_header ⇒ Object
Used to declare an array as an AMQP array.
Class Method Summary collapse
-
.proton_get(data) ⇒ Object
Gets the elements of an array or list out of the specified Qpid::Proton::Data object.
Instance Method Summary collapse
-
#proton_described? ⇒ Boolean
Returns true if the array is the a Proton described type.
-
#proton_put(data) ⇒ Object
Puts the elements of the array into the specified Qpid::Proton::Data object.
Instance Attribute Details
#proton_array_header ⇒ Object
Used to declare an array as an AMQP array.
The value, if defined, is an instance of Qpid::Proton::Types::ArrayHeader
61 62 63 |
# File 'lib/types/array.rb', line 61 def proton_array_header @proton_array_header end |
Class Method Details
.proton_get(data) ⇒ Object
Gets the elements of an array or list out of the specified Qpid::Proton::Data object.
113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/types/array.rb', line 113 def proton_get(data) raise TypeError, "can't convert nil into Qpid::Proton::Data" if data.nil? type = data.type if type == Qpid::Proton::Codec::LIST result = proton_get_list(data) elsif type == Qpid::Proton::Codec::ARRAY result = proton_get_array(data) else raise TypeError, "element is not a list and not an array" end end |
Instance Method Details
#proton_described? ⇒ Boolean
Returns true if the array is the a Proton described type.
64 65 66 |
# File 'lib/types/array.rb', line 64 def proton_described? !@proton_array_header.nil? && @proton_array_header.described? end |
#proton_put(data) ⇒ Object
Puts the elements of the array into the specified Qpid::Proton::Data object.
69 70 71 72 73 74 75 76 77 |
# File 'lib/types/array.rb', line 69 def proton_put(data) raise TypeError, "data object cannot be nil" if data.nil? if @proton_array_header.nil? proton_put_list(data) else proton_put_array(data) end end |