Class: Babelish::Android2CSV
- Defined in:
- lib/babelish/android2csv.rb
Instance Attribute Summary
Attributes inherited from Base2Csv
#csv_filename, #default_lang, #filenames, #headers
Instance Method Summary collapse
-
#initialize(args = {:filenames => []}) ⇒ Android2CSV
constructor
A new instance of Android2CSV.
- #load_strings(strings_filename) ⇒ Object
Methods inherited from Base2Csv
Constructor Details
#initialize(args = {:filenames => []}) ⇒ Android2CSV
Returns a new instance of Android2CSV.
5 6 7 |
# File 'lib/babelish/android2csv.rb', line 5 def initialize(args = {:filenames => []}) super(args) end |
Instance Method Details
#load_strings(strings_filename) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/babelish/android2csv.rb', line 9 def load_strings(strings_filename) strings = {} raise Errno::ENOENT unless File.exist?(strings_filename) xmlfile = XmlSimple.xml_in(strings_filename) xmlfile['string'].each do |element| if !element.nil? && !element['name'].nil? content = element['content'].nil? ? '' : element['content'] strings.merge!({element['name'] => content}) end end strings end |