module LSVplus::FormattingHelper
Constants
- DATE_FORMAT
Public Class Methods
account(account)
click to toggle source
# File lib/lsv_plus/formatting_helper.rb, line 26 def self.account(account) format '%-34s', account end
amount(amount)
click to toggle source
# File lib/lsv_plus/formatting_helper.rb, line 13 def self.amount(amount) format('%012.2f', amount).sub('.', ',') end
clearing_number(number)
click to toggle source
# File lib/lsv_plus/formatting_helper.rb, line 30 def self.clearing_number(number) format '%-5s', number end
date(date)
click to toggle source
# File lib/lsv_plus/formatting_helper.rb, line 5 def self.date(date) date.strftime DATE_FORMAT end
index(index)
click to toggle source
# File lib/lsv_plus/formatting_helper.rb, line 9 def self.index(index) format '%07d', index end
multiline(lines)
click to toggle source
# File lib/lsv_plus/formatting_helper.rb, line 17 def self.multiline(lines) lines_string = StringIO.new 4.times do |index| lines_string.write format('%-35s', lines[index]) end lines_string.rewind lines_string.read end