Class: OpenXml::Pptx::Package

Inherits:
OpenXml::Package
  • Object
show all
Defined in:
lib/openxml/pptx/package.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#presentationObject (readonly)

Returns the value of attribute presentation.



7
8
9
# File 'lib/openxml/pptx/package.rb', line 7

def presentation
  @presentation
end

Instance Method Details

#add_default(extension, type) ⇒ Object



13
14
15
# File 'lib/openxml/pptx/package.rb', line 13

def add_default(extension, type)
  content_types.add_default extension, type
end

#add_override(part_name, content_type) ⇒ Object



9
10
11
# File 'lib/openxml/pptx/package.rb', line 9

def add_override(part_name, content_type)
  content_types.add_override "/#{part_name}", content_type
end

#has_part?(part) ⇒ Boolean

EXTRACT: to openxml-package

Returns:

  • (Boolean)


18
19
20
# File 'lib/openxml/pptx/package.rb', line 18

def has_part?(part)
  parts.has_value?(part)
end

#set_defaultsObject



22
23
24
25
26
27
28
29
# File 'lib/openxml/pptx/package.rb', line 22

def set_defaults
  super
  @presentation = OpenXml::Pptx::Parts::Presentation.new parent: self
  add_part presentation.path.to_s, presentation
  add_part presentation.relationships_path, presentation.relationships
  add_override presentation.path.to_s, presentation.content_type
  rels.add_relationship presentation.relationship_type, presentation.path
end