class YamlTranslator::Context

Public Class Methods

new(locale, translator) click to toggle source
# File lib/yaml-translator/context.rb, line 3
def initialize(locale, translator)
  @locale = locale
  @translator = translator
end

Public Instance Methods

all(targets) click to toggle source
# File lib/yaml-translator/context.rb, line 12
def all(targets)
  targets.map { |target| @locale.translate(@translator, to: target) }
end
to(target) click to toggle source
# File lib/yaml-translator/context.rb, line 8
def to(target)
  @locale.translate(@translator, to: target)
end