Sha256: b56ee868432b06b28e0e469c4e5fc2370e381a3288d274735cc21d6c5e3d3db7

Contents?: true

Size: 472 Bytes

Versions: 1

Compression:

Stored size: 472 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('@@', "\n").gsub('-0000', '+0000')
      mt940 = Cmxl.parse(processed_data)
      mt940.flat_map(&:transactions)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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