Class: YamlTranslator::TranslatedResult
- Inherits:
-
Object
- Object
- YamlTranslator::TranslatedResult
- Defined in:
- lib/yaml-translator/translated_result.rb
Instance Attribute Summary collapse
-
#lang ⇒ Object
readonly
Returns the value of attribute lang.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(values, lang) ⇒ TranslatedResult
constructor
A new instance of TranslatedResult.
- #save_to(dir) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(values, lang) ⇒ TranslatedResult
7 8 9 10 |
# File 'lib/yaml-translator/translated_result.rb', line 7 def initialize(values, lang) @lang = lang @values = values end |
Instance Attribute Details
#lang ⇒ Object (readonly)
Returns the value of attribute lang.
5 6 7 |
# File 'lib/yaml-translator/translated_result.rb', line 5 def lang @lang end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
5 6 7 |
# File 'lib/yaml-translator/translated_result.rb', line 5 def values @values end |
Instance Method Details
#save_to(dir) ⇒ Object
12 13 14 |
# File 'lib/yaml-translator/translated_result.rb', line 12 def save_to(dir) File.write("#{dir}/#{lang}.yml", YAML.dump(@values)) end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/yaml-translator/translated_result.rb', line 16 def to_s @values.to_s end |