Class: ISO8583::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/iso8583-mkb/iso8583_patches.rb

Direct Known Subclasses

ISO8583::MKB::MKBMessage

Class Method Summary collapse

Class Method Details

.parse(str) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/iso8583-mkb/iso8583_patches.rb', line 26

def self.parse(str)
  message = self.new
  message.mti, rest = _mti_format.parse(str)
  bmp,rest = Bitmap.parse(rest)
  bmp.each {|bit|
           next if bit < 2
           bmp_def = _definitions[bit]
           value, rest = bmp_def.field.parse(rest)
           message[bit] = value
  }
  message
end