Class: YamlTranslator::Context
- Inherits:
-
Object
- Object
- YamlTranslator::Context
- Defined in:
- lib/yaml-translator/context.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(locale, translator) ⇒ Context
constructor
A new instance of Context.
- #to(lang) ⇒ Object
Constructor Details
#initialize(locale, translator) ⇒ Context
Returns a new instance of Context.
3 4 5 6 |
# File 'lib/yaml-translator/context.rb', line 3 def initialize(locale, translator) @locale = locale @translator = translator end |
Instance Method Details
#to(lang) ⇒ Object
7 8 9 |
# File 'lib/yaml-translator/context.rb', line 7 def to(lang) @translator.translate(@locale, to: lang) end |