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)
-
- (String) ContentType
ContentType The type of content.
-
- (String) PartName
PartName The name and location of the part.
Instance Method Summary (collapse)
-
- (Override) initialize(options = {})
constructor
Creates a new Override object.
-
- (Object) to_xml(xml)
Serializes the Override object to xml.
Constructor Details
- (Override) initialize(options = {})
Creates a new Override object
15 16 17 18 19 20 |
# File 'lib/axlsx/content_type/override.rb', line 15 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
- (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
6 7 8 |
# File 'lib/axlsx/content_type/override.rb', line 6 def ContentType @ContentType end |
- (String) PartName
PartName The name and location of the part.
9 10 11 |
# File 'lib/axlsx/content_type/override.rb', line 9 def PartName @PartName end |
Instance Method Details
- (Object) to_xml(xml)
Serializes the Override object to xml
26 27 28 |
# File 'lib/axlsx/content_type/override.rb', line 26 def to_xml(xml) xml.Override(self.instance_values) end |