Class: Uniword::Docx::PartLoader::ThemeMediaLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/uniword/docx/part_loader/theme_media_loader.rb

Overview

Loads theme media files (word/theme/media/*) into the parsed theme's media_files. Runs only when a theme part was loaded — theme media without a theme is ignored, as before.

Instance Method Summary collapse

Instance Method Details

#load(context, definition) ⇒ void

This method returns an undefined value.

Parameters:



13
14
15
16
17
18
19
# File 'lib/uniword/docx/part_loader/theme_media_loader.rb', line 13

def load(context, definition)
  theme = context.package.theme
  return unless theme

  media = extract_media(context, definition)
  theme.media_files = media if media.any?
end