Module: SEPA::Converter::InstanceMethods
- Defined in:
- lib/sepa_king/converter.rb
Instance Method Summary collapse
Instance Method Details
#convert_decimal(value) ⇒ Object
30 31 32 33 |
# File 'lib/sepa_king/converter.rb', line 30 def convert_decimal(value) return unless value BigDecimal(value.to_s).round(2) end |
#convert_text(value) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/sepa_king/converter.rb', line 18 def convert_text(value) return unless value I18n.transliterate(value.to_s). # Change linebreaks to whitespaces gsub(/\n+/,' '). # Remove all invalid characters gsub(/[^a-zA-Z0-9\ \'\:\?\,\-\(\+\.\)\/]/, ''). # Remove leading and trailing spaces strip end |