Class: Rex::Proto::Amqp::Version091::Frames::AmqpVersion091MethodFrame

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

Instance Method Summary collapse

Instance Method Details

#initialize_instanceObject



76
77
78
79
80
# File 'lib/rex/proto/amqp/version_0_9_1/frames.rb', line 76

def initialize_instance
  super

  header.frame_type = 1
end

#initialize_shared_instanceObject



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/rex/proto/amqp/version_0_9_1/frames.rb', line 59

def initialize_shared_instance
  super

  define_singleton_method(:arguments=) do |args|
    if args.class.const_defined?(:CLASS_ID)
      self.class_id = args.class::CLASS_ID
    end
    if args.class.const_defined?(:METHOD_ID)
      self.method_id = args.class::METHOD_ID
    end

    index = @field_names.index(:arguments)
    instantiate_obj_at(index) if @field_objs[index].nil?
    @field_objs[index].assign(args)
  end
end