Class: Hoodie::Inflections::RulesCollection
- Defined in:
- lib/hoodie/inflections/rules_collection.rb
Overview
Wraps inflections array
Instance Method Summary collapse
-
#apply_to(word) ⇒ String
private
Applies first found rule to given word.
Instance Method Details
#apply_to(word) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Applies first found rule to given word
13 14 15 16 17 |
# File 'lib/hoodie/inflections/rules_collection.rb', line 13 def apply_to(word) result = word.dup each { |rule, replacement| break if result.gsub!(rule, replacement) } result end |