Class: I18n::Backend::Transliterator::ProcTransliterator
- Defined in:
- lib/active_support/vendor/i18n-0.4.1/i18n/backend/transliterator.rb
Overview
A transliterator which accepts a Proc as its transliteration rule.
Instance Method Summary collapse
-
#initialize(rule) ⇒ ProcTransliterator
constructor
A new instance of ProcTransliterator.
- #transliterate(string, replacement = nil) ⇒ Object
Constructor Details
#initialize(rule) ⇒ ProcTransliterator
Returns a new instance of ProcTransliterator.
29 30 31 |
# File 'lib/active_support/vendor/i18n-0.4.1/i18n/backend/transliterator.rb', line 29 def initialize(rule) @rule = rule end |
Instance Method Details
#transliterate(string, replacement = nil) ⇒ Object
33 34 35 |
# File 'lib/active_support/vendor/i18n-0.4.1/i18n/backend/transliterator.rb', line 33 def transliterate(string, replacement = nil) @rule.call(string) end |