class Axlsx::AbstractContentType

This class extracts the common parts from Default and Override

Attributes

ContentType[R]

The type of content. @return [String]

content_type[R]

The type of content. @return [String]

Public Class Methods

new(options={}) click to toggle source

Initializes an abstract content type @see Default, Override

# File lib/axlsx/content_type/abstract_content_type.rb, line 10
def initialize(options={})
   parse_options options
end

Public Instance Methods

ContentType=(v)
Alias for: content_type=
content_type=(v) click to toggle source

The content type. @see Axlsx#validate_content_type

# File lib/axlsx/content_type/abstract_content_type.rb, line 21
def content_type=(v) Axlsx::validate_content_type v; @content_type = v end
Also aliased as: ContentType=
to_xml_string(node_name = '', str = '') click to toggle source

Serialize the contenty type to xml

# 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