Class: Axlsx::AbstractContentType
- Inherits:
-
Object
- Object
- Axlsx::AbstractContentType
- Includes:
- OptionsParser
- Defined in:
- lib/axlsx/content_type/abstract_content_type.rb
Overview
This class extracts the common parts from Default and Override
Instance Attribute Summary collapse
-
#content_type ⇒ String
(also: #ContentType)
The type of content.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ AbstractContentType
constructor
Initializes an abstract content type.
-
#to_xml_string(node_name = '', str = +'')) ⇒ Object
Serialize the content type to xml.
Methods included from OptionsParser
Constructor Details
#initialize(options = {}) ⇒ AbstractContentType
Initializes an abstract content type
10 11 12 |
# File 'lib/axlsx/content_type/abstract_content_type.rb', line 10 def initialize( = {}) end |
Instance Attribute Details
#content_type ⇒ String Also known as: ContentType
The type of content.
16 17 18 |
# File 'lib/axlsx/content_type/abstract_content_type.rb', line 16 def content_type @content_type end |
Instance Method Details
#to_xml_string(node_name = '', str = +'')) ⇒ Object
Serialize the content type to xml
28 29 30 31 32 33 34 35 |
# File 'lib/axlsx/content_type/abstract_content_type.rb', line 28 def to_xml_string(node_name = '', str = +'') str << '<' << node_name << ' ' Axlsx.instance_values_for(self).each_with_index do |key_value, index| str << ' ' unless index == 0 str << Axlsx.camel(key_value.first) << '="' << key_value.last.to_s << '"' end str << '/>' end |