Class: C11n::Exporter::Ios
- Inherits:
-
Object
- Object
- C11n::Exporter::Ios
- Defined in:
- lib/c11n/exporter/ios.rb
Instance Method Summary collapse
- #export(translations, locale) ⇒ Object
- #file ⇒ Object
-
#initialize(options = {}) ⇒ Ios
constructor
A new instance of Ios.
Constructor Details
#initialize(options = {}) ⇒ Ios
Returns a new instance of Ios.
4 5 6 |
# File 'lib/c11n/exporter/ios.rb', line 4 def initialize( = {}) @path = [:path] end |
Instance Method Details
#export(translations, locale) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/c11n/exporter/ios.rb', line 8 def export(translations, locale) file.print(translations.translations_for(locale).map do |key, translation| "\"#{key}\" = \"#{translation}\";" end.join("\n")) file.close end |
#file ⇒ Object
16 17 18 |
# File 'lib/c11n/exporter/ios.rb', line 16 def file @file ||= File.new(@path, 'w') end |