Class: Axlsx::Override
- Inherits:
-
Object
- Object
- Axlsx::Override
- Defined in:
- lib/axlsx/content_type/override.rb
Overview
An override 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.
-
#PartName ⇒ String
The name and location of the part.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Override
constructor
Creates a new Override object.
-
#to_xml(xml) ⇒ Object
Serializes the Override object to xml.
Constructor Details
#initialize(options = {}) ⇒ Override
Creates a new Override object
17 18 19 20 21 22 |
# File 'lib/axlsx/content_type/override.rb', line 17 def initialize(={}) raise ArgumentError, "PartName and ContentType are required" unless [:PartName] && [: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.
7 8 9 |
# File 'lib/axlsx/content_type/override.rb', line 7 def ContentType @ContentType end |
#PartName ⇒ String
The name and location of the part.
11 12 13 |
# File 'lib/axlsx/content_type/override.rb', line 11 def PartName @PartName end |
Instance Method Details
#to_xml(xml) ⇒ Object
Serializes the Override object to xml
33 34 35 |
# File 'lib/axlsx/content_type/override.rb', line 33 def to_xml(xml) xml.Override(self.instance_values) end |