Module: Gemmy::Patches::StringPatch::InstanceMethods::NumbersToEnglish
- Defined in:
- lib/gemmy/patches/string_patch.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#numbers_to_english ⇒ Object
Converts a string’s numbers to english words.
Class Method Details
.numbers_to_english(string) ⇒ Object
40 41 42 |
# File 'lib/gemmy/patches/string_patch.rb', line 40 def self.numbers_to_english(string) string.gsub(/(\d+)/) { |num| num.humanize } end |
Instance Method Details
#numbers_to_english ⇒ Object
Converts a string’s numbers to english words
37 38 39 |
# File 'lib/gemmy/patches/string_patch.rb', line 37 def numbers_to_english Gemmy.patch("string/i/numbers_to_english").numbers_to_english(self) end |