Module: Num2words::Rails::Helpers

Defined in:
lib/num2words/rails/helpers.rb

Instance Method Summary collapse

Instance Method Details

#currency_to_words(amount, locale: I18n.locale, **options) ⇒ Object



10
11
12
# File 'lib/num2words/rails/helpers.rb', line 10

def currency_to_words(amount, locale: I18n.locale, **options)
  Num2words.to_currency(amount, locale: locale, **options)
end

#date_to_words(date, locale: I18n.locale, **options) ⇒ Object



14
15
16
# File 'lib/num2words/rails/helpers.rb', line 14

def date_to_words(date, locale: I18n.locale, **options)
  Num2words.to_words(date, locale: locale, **options)
end

#datetime_to_words(datetime, locale: I18n.locale, **options) ⇒ Object



22
23
24
# File 'lib/num2words/rails/helpers.rb', line 22

def datetime_to_words(datetime, locale: I18n.locale, **options)
  Num2words.to_words(datetime, locale: locale, **options)
end

#number_to_words(number, locale: I18n.locale, **options) ⇒ Object



6
7
8
# File 'lib/num2words/rails/helpers.rb', line 6

def number_to_words(number, locale: I18n.locale, **options)
  Num2words.to_words(number, locale: locale, **options)
end

#time_to_words(time, locale: I18n.locale, **options) ⇒ Object



18
19
20
# File 'lib/num2words/rails/helpers.rb', line 18

def time_to_words(time, locale: I18n.locale, **options)
  Num2words.to_words(time, locale: locale, **options)
end