Class: YamlTranslator::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/yaml-translator/context.rb

Direct Known Subclasses

DiffContext, FileContext, StringContext

Instance Method Summary collapse

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