Sha256: 462630f37329ecd8e7710fbe569d027affcaf2c813171c0fa1467dc4616ac3f8

Contents?: true

Size: 502 Bytes

Versions: 1

Compression:

Stored size: 502 Bytes

Contents

module FinTS
  class Helper
    def self.fints_escape(content)
      content.gsub('?', '??').gsub('+', '?+').gsub(':', '?:').gsub("'", "?'")
    end

    def self.fints_unescape(content)
      content.gsub('??', '?').gsub("?'", "'").gsub('?+', '+').gsub('?:', ':')
    end
    
    def self.mt940_to_array(data)
      processed_data = data.gsub('@@', '\r\n').gsub('-0000', '+0000')
      mt940 = Cmxl.parse(processed_data, encoding: 'ISO-8859-1')
      mt940.flat_map(&:transactions)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_fints-0.0.2 lib/fints/helper.rb