Sha256: c282090c74c1848ef1ffa6a6ba824c579973bb705bde5fe03f38631c2d4fa097

Contents?: true

Size: 854 Bytes

Versions: 8

Compression:

Stored size: 854 Bytes

Contents

module Axlsx

  # This class extracts the common parts from Default and Override
  class AbstractContentType

    include Axlsx::OptionsParser

    # Initializes an abstract content type
    # @see Default, Override
    def initialize(options={})
       parse_options options
    end

    # The type of content.
    # @return [String]
    attr_reader :content_type
    alias :ContentType :content_type

    # The content type.
    # @see Axlsx#validate_content_type
    def content_type=(v) Axlsx::validate_content_type v; @content_type = v end
    alias :ContentType= :content_type=

    # Serialize the contenty type to xml
    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

  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
caxlsx-2.0.2 lib/axlsx/content_type/abstract_content_type.rb
axlsx-2.0.1 lib/axlsx/content_type/abstract_content_type.rb
axlsx-2.0.0 lib/axlsx/content_type/abstract_content_type.rb
axlsx-1.3.6 lib/axlsx/content_type/abstract_content_type.rb
axlsx-1.3.5 lib/axlsx/content_type/abstract_content_type.rb
axlsx-1.3.4 lib/axlsx/content_type/abstract_content_type.rb
axlsx-1.3.3 lib/axlsx/content_type/abstract_content_type.rb
axlsx-1.3.2 lib/axlsx/content_type/abstract_content_type.rb