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.
Constant Summary collapse
- INVALID_ARGUMENTS =
Error string for option validation
"extension and content_type are required"
Instance Attribute Summary collapse
-
#content_type ⇒ String
(also: #ContentType)
The type of content.
-
#extension ⇒ String
(also: #Extension)
The extension of the content type.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Default
constructor
Creates a new Default object.
-
#to_xml_string(str = '') ⇒ String
Serializes the object.
Constructor Details
#initialize(options = {}) ⇒ Default
Creates a new Default object
11 12 13 14 15 16 |
# File 'lib/axlsx/content_type/default.rb', line 11 def initialize(={}) raise ArgumentError, INVALID_ARGUMENTS unless () .each do |name, value| self.send("#{name}=", value) if self.respond_to? "#{name}=" end end |
Instance Attribute Details
#content_type ⇒ String Also known as: ContentType
The type of content.
28 29 30 |
# File 'lib/axlsx/content_type/default.rb', line 28 def content_type @content_type end |
#extension ⇒ String Also known as: Extension
The extension of the content type.
23 24 25 |
# File 'lib/axlsx/content_type/default.rb', line 23 def extension @extension end |