Class: YamlTranslator::Translator
- Inherits:
-
Object
- Object
- YamlTranslator::Translator
- Defined in:
- lib/yaml-translator/translator.rb
Instance Method Summary collapse
-
#initialize(adapter = Adapters::NoopAdaptor.new) ⇒ Translator
constructor
A new instance of Translator.
-
#translate(values, options = {}) ⇒ Hash
Translate target.
Constructor Details
#initialize(adapter = Adapters::NoopAdaptor.new) ⇒ Translator
Returns a new instance of Translator.
5 6 7 8 |
# File 'lib/yaml-translator/translator.rb', line 5 def initialize(adapter = Adapters::NoopAdaptor.new) @path = KeyPath.new @adapter = adapter end |
Instance Method Details
#translate(values, options = {}) ⇒ Hash
Translate target
14 15 16 |
# File 'lib/yaml-translator/translator.rb', line 14 def translate(values, ={}) TranslatedResult.new(rebuild(translate_tree(flatten(values), )), [:to]) end |