Class: Uniword::ContentTypes::Types

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/uniword/content_types/types.rb

Overview

Content types root element for [Content_Types].xml

Generated from OOXML schema: content_types.yml Element: ct:Types

Instance Method Summary collapse

Instance Method Details

#content_type_for(path) ⇒ String?

Resolve the content type declared for a package-relative path.

Override entries win; the Default extension match is the fallback. Returns nil when neither matches (the part is non-compliant per OPC).

Parameters:

  • path (String)

    package-relative path (e.g. "word/document.xml")

Returns:

  • (String, nil)

    content type, or nil when undeclared



31
32
33
# File 'lib/uniword/content_types/types.rb', line 31

def content_type_for(path)
  override_content_type(path) || default_content_type(path)
end