Class: Garcon::Inflections::RulesCollection
- Defined in:
- lib/garcon/inflections/rules_collection.rb
Overview
Wraps inflections array
Instance Method Summary collapse
-
#apply_to(word) ⇒ String
private
Applies first found rule to given word.
Methods inherited from Array
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
30 31 32 33 34 |
# File 'lib/garcon/inflections/rules_collection.rb', line 30 def apply_to(word) result = word.dup each { |rule, replacement| break if result.gsub!(rule, replacement) } result end |