class Qpid::Proton::Types::UniformArray
*Unsettled API* - An array that is converted to/from an AMQP array of uniform element type. A plain ruby ::Array
is converted to/from an AMQP list, which can contain mixed type elements. If invalid elements are included, then {TypeError} will be raised when encoding to AMQP.
Attributes
@return [Object] Optional descriptor.
@return [Type] Array
elements must be convertible to this AMQP type
Public Class Methods
Construct a uniform array, which will be converted to an AMQP array. A plain ruby ::Array
is converted to/from an AMQP list, containing mixed type elements.
@param type [Type] Elements must be convertible to this AMQP type. @param elements [Enumerator] Initial elements for the array @param descriptor [Object] Optional array descriptor
# File lib/types/array.rb, line 50 def initialize(type, elements=nil, descriptor=nil) @type, @descriptor = type, descriptor @proton_array_header = nil raise ArgumentError, "no type specified for array" if @type.nil? super elements if elements end
Public Instance Methods
# File lib/types/array.rb, line 70 def <=>(x) ret = [@type, @descriptor] <=> [x.type, x.descriptor] ret == 0 ? super : ret end
# File lib/types/array.rb, line 68 def inspect() "#{self.class.name}<#{type}>#{super}"; end
@deprecated backwards compatibility {UniformArray}
# File lib/types/array.rb, line 58 def proton_array_header @proton_array_header ||= ArrayHeader.new(@type, @descriptor) # Deprecated end