Class: Rex::Proto::Amqp::Version091::Types::AmqpVersion091FieldTable
- Inherits:
-
BinData::Primitive
- Object
- BinData::Primitive
- Rex::Proto::Amqp::Version091::Types::AmqpVersion091FieldTable
- Defined in:
- lib/rex/proto/amqp/version_0_9_1/types.rb,
lib/rex/proto/amqp/version_0_9_1/types.rb
Overview
Compound Forward Declarations
Instance Method Summary collapse
-
#coerce ⇒ Hash<String, Object>
Coerce the table into a Ruby hash without the AMQP type metadata.
- #get ⇒ Object
- #set(v) ⇒ Object
Instance Method Details
#coerce ⇒ Hash<String, Object>
Coerce the table into a Ruby hash without the AMQP type metadata.
149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/rex/proto/amqp/version_0_9_1/types.rb', line 149 def coerce content.map do |item| case item.data.data_type when 'A'.ord # field-array [item.name.to_s, item.data.data.coerce] when 'F'.ord # field-table [item.name.to_s, item.data.data.coerce] else [item.name.to_s, item.data.data.snapshot] end end.to_h end |
#get ⇒ Object
138 139 140 |
# File 'lib/rex/proto/amqp/version_0_9_1/types.rb', line 138 def get self.content end |
#set(v) ⇒ Object
142 143 144 |
# File 'lib/rex/proto/amqp/version_0_9_1/types.rb', line 142 def set(v) self.content = v end |