lib/fix/protocol/message.rb
#
# Dumps this message as a FIX protocol message, it will automatically
# calculate the body length and and checksum
#
# @return [String] The FIX message
#
Dumps this message as a FIX protocol message, it will automatically
calculate the body length and and checksum
Dumps this message as a FIX protocol message it will automatically calculate the body length and and checksum
def dump
        if valid?
          dumped = super
          header.body_length = dumped.gsub(/^8=[^\x01]+\x01/, '').gsub(/^9=[^\x01]+\x01/, '').length
          dumped = super
          "#{dumped}10=#{'%03d' % (dumped.bytes.inject(&:+) % 256)}\x01"
        end
      end
def dump if valid? dumped = super header . body_length = dumped . gsub ( / ^8=[^ \x01 ]+ \x01 / , '' ) . gsub ( / ^9=[^ \x01 ]+ \x01 / , '' ) . length dumped = super "#{dumped}10=#{'%03d' % (dumped.bytes.inject(&:+) % 256)}\x01" end end
Dumps this message as a FIX protocol message, it will automatically
calculate the body length and and checksum
Dumps this message as a FIX protocol message it will automatically calculate the body length and and checksum
The FIX message
The FIX message
String