Class: FileTemplateExporter
- Inherits:
-
Object
- Object
- FileTemplateExporter
- Defined in:
- lib/file_template_exporter.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
-
#initialize(file_template) ⇒ FileTemplateExporter
constructor
A new instance of FileTemplateExporter.
- #to_xml ⇒ Object
Constructor Details
#initialize(file_template) ⇒ FileTemplateExporter
Returns a new instance of FileTemplateExporter.
6 7 8 9 |
# File 'lib/file_template_exporter.rb', line 6 def initialize(file_template) @file_template = file_template @filename = "TemplateInfo.plist" end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
4 5 6 |
# File 'lib/file_template_exporter.rb', line 4 def filename @filename end |
Instance Method Details
#to_xml ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/file_template_exporter.rb', line 11 def to_xml file_template = EmptyTemplate.read("file_template") file_template.gsub!("{{IDENTIFIER}}", @file_template.identifier) file_definitions_to_xml = file_definitions.collect do |file_definition| file_definition_to_xml(file_definition) end.join("\n") file_template.gsub!("{{FILE_DEFINITIONS}}", file_definitions_to_xml) file_template.gsub!("{{FILE_DEFINITIONS_LIST}}", file_definition_list_as_xml) file_template end |