Class: NumbersInWords::ToWord
- Inherits:
-
Object
- Object
- NumbersInWords::ToWord
- Defined in:
- lib/numbers_in_words/to_word.rb
Instance Method Summary collapse
- #in_english ⇒ Object
- #in_words(language = nil) ⇒ Object
-
#initialize(that, language = NumbersInWords.language) ⇒ ToWord
constructor
A new instance of ToWord.
Constructor Details
#initialize(that, language = NumbersInWords.language) ⇒ ToWord
Returns a new instance of ToWord.
2 3 4 5 |
# File 'lib/numbers_in_words/to_word.rb', line 2 def initialize that, language=NumbersInWords.language @that = that @language = language end |
Instance Method Details
#in_english ⇒ Object
16 17 18 |
# File 'lib/numbers_in_words/to_word.rb', line 16 def in_english NumbersInWords::English::LanguageWriterEnglish.new(@that).in_words end |
#in_words(language = nil) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/numbers_in_words/to_word.rb', line 7 def in_words language=nil language ||= @language case language when "English" #allow for I18n in_english end end |