Class: Rex::Proto::Amqp::Version091::Types::AmqpVersion091FieldArray

Inherits:
BinData::Primitive
  • Object
show all
Defined in:
lib/rex/proto/amqp/version_0_9_1/types.rb

Instance Method Summary collapse

Instance Method Details

#coerceArray<Object>

Coerce the table into a Ruby array without the AMQP type metadata.

Returns:

  • (Array<Object>)


117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/rex/proto/amqp/version_0_9_1/types.rb', line 117

def coerce
  content.map do |item|
    case item.data_type
    when 'A'.ord # field-array
      item.data.coerce
    when 'F'.ord # field-table
      item.data.coerce
    else
      item.data.snapshot
    end
  end
end

#getObject



106
107
108
# File 'lib/rex/proto/amqp/version_0_9_1/types.rb', line 106

def get
  self.content
end

#set(v) ⇒ Object



110
111
112
# File 'lib/rex/proto/amqp/version_0_9_1/types.rb', line 110

def set(v)
  self.content = v
end