Method: Codec::Numebc#encode

Defined in:
lib/codec/fix.rb

#encode(buf, field) ⇒ Object



93
94
95
96
97
98
99
100
101
# File 'lib/codec/fix.rb', line 93

def encode(buf, field)
  out = field.get_value.to_s
  if @length > 0
    out = out.rjust(@length,"0")
    raise TooLongDataException if out.length > @length
  end
  buf << EightBitsEncoding::UTF8_2_EBCDIC(out)
  return out.length      
end