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 contenty 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 contenty type to xml
25 26 27 28 29 |
# File 'lib/axlsx/content_type/abstract_content_type.rb', line 25 def to_xml_string(node_name = '', str = '') str << "<#{node_name} " str << instance_values.map { |key, value| Axlsx::camel(key) << '="' << value.to_s << '"' }.join(' ') str << '/>' end |