Class: Uniword::Docx::PartLoader::EmbeddingLoader

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

Overview

Loads OLE/embedded object binaries (word/embeddings/*) into the package's embeddings collection, keyed by relationship target (path relative to word/).

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
20
21
22
# File 'lib/uniword/docx/part_loader/embedding_loader.rb', line 13

def load(context, definition)
  paths = context.matching_paths(definition)
  return if paths.empty?

  embeddings = context.package.embeddings
  paths.each do |path|
    embeddings[path.delete_prefix("word/")] =
      context.zip_content[path]
  end
end