Class: ISO8583::BCDField
Instance Attribute Summary
Attributes inherited from Field
#bmp, #codec, #max, #name, #padding
Instance Method Summary collapse
-
#length ⇒ Object
This corrects the length for BCD fields, as their encoded length is half (+ parity) of the content length.
Methods inherited from Field
Instance Method Details
#length ⇒ Object
This corrects the length for BCD fields, as their encoded length is half (+ parity) of the content length. E.g. 123 (length = 3) encodes to “x01x23” (length 2)
84 85 86 87 |
# File 'lib/iso8583/field.rb', line 84 def length _length = super (_length % 2) != 0 ? (_length / 2) + 1 : _length / 2 end |