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
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
17 18 19 20 21 22 |
# File 'lib/axlsx/content_type/default.rb', line 17 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
The type of content.
11 12 13 |
# File 'lib/axlsx/content_type/default.rb', line 11 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
33 34 35 |
# File 'lib/axlsx/content_type/default.rb', line 33 def to_xml(xml) xml.Default(self.instance_values) end |