Class: Axlsx::ContentType
- Inherits:
-
SimpleTypedList
- Object
- SimpleTypedList
- Axlsx::ContentType
- Defined in:
- lib/axlsx/content_type/content_type.rb
Overview
ContentTypes used in the package. This is automatically managed by the package package.
Instance Method Summary collapse
-
#initialize ⇒ ContentType
constructor
A new instance of ContentType.
-
#to_xml ⇒ String
Generates the xml document for [Content_Types].xml.
Constructor Details
#initialize ⇒ ContentType
Returns a new instance of ContentType.
9 10 11 |
# File 'lib/axlsx/content_type/content_type.rb', line 9 def initialize super [Override, Default] end |
Instance Method Details
#to_xml ⇒ String
Generates the xml document for [Content_Types].xml
15 16 17 18 19 20 21 22 |
# File 'lib/axlsx/content_type/content_type.rb', line 15 def to_xml() builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml| xml.Types(:xmlns => Axlsx::XML_NS_T) { each { |type| type.to_xml(xml) } } end builder.to_xml(:save_with => 0) end |