class Terrestrial::Cli::AndroidXmlFormatter

Public Class Methods

new(entries) click to toggle source
# File lib/terrestrial/cli/android_xml_formatter.rb, line 7
def initialize(entries)
  @entries = entries
end

Public Instance Methods

format_foreign_translation() click to toggle source
# File lib/terrestrial/cli/android_xml_formatter.rb, line 11
def format_foreign_translation
  root = REXML::Element.new("resources")

  entries.each do |entry|
    root.add_element("string", {
      "name"    => entry.identifier 
    }).add_text(entry.string)
  end

  print_xml(root)
end
print_xml(document) click to toggle source

Private Instance Methods

entries() click to toggle source
# File lib/terrestrial/cli/android_xml_formatter.rb, line 38
def entries
  @entries
end