Class: Axlsx::Default
- Inherits:
-
Object
- Object
- Axlsx::Default
- Defined in:
- lib/axlsx/content_type/default.rb
Overview
An default content part. These parts are automatically created by for you based on the content of your package.
Instance Attribute Summary (collapse)
-
- (String) ContentType
ContentType The type of content.
-
- (String) Extension
The extension of the content type.
Instance Method Summary (collapse)
-
- (Default) initialize(options = {})
constructor
Creates a new Default object.
-
- (String) to_xml(xml)
Serializes the object to xml.
Constructor Details
- (Default) initialize(options = {})
Creates a new Default object
16 17 18 19 20 21 |
# File 'lib/axlsx/content_type/default.rb', line 16 def initialize(={}) raise ArgumentError, "Extension and ContentType are required" unless [:Extension] && [:ContentType] .each do |o| self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" end end |
Instance Attribute Details
- (String) ContentType
ContentType The type of content. TABLE_CT, WORKBOOK_CT, APP_CT, RELS_CT, STYLES_CT, XML_CT, WORKSHEET_CT, SHARED_STRINGS_CT, CORE_CT, CHART_CT, DRAWING_CT are allowed
10 11 12 |
# File 'lib/axlsx/content_type/default.rb', line 10 def ContentType @ContentType end |
- (String) Extension
The extension of the content type.
7 8 9 |
# File 'lib/axlsx/content_type/default.rb', line 7 def Extension @Extension end |
Instance Method Details
- (String) to_xml(xml)
Serializes the object to xml
28 29 30 |
# File 'lib/axlsx/content_type/default.rb', line 28 def to_xml(xml) xml.Default(self.instance_values) end |