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
-
#ContentType ⇒ String
The type of content.
-
#Extension ⇒ String
The extension of the content type.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Default
constructor
Creates a new Default object.
-
#to_xml(xml) ⇒ String
Serializes the object to xml.
Constructor Details
#initialize(options = {}) ⇒ Default
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
#ContentType ⇒ String
The type of content.
11 12 13 |
# File 'lib/axlsx/content_type/default.rb', line 11 def ContentType @ContentType end |
#Extension ⇒ String
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
#to_xml(xml) ⇒ String
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 |