Class: PPTX::OPC::BasePart
- Inherits:
-
Object
- Object
- PPTX::OPC::BasePart
show all
- Defined in:
- lib/pptx/opc/base_part.rb
Overview
A part without relationships.
Instance Method Summary
collapse
Constructor Details
#initialize(package, part_name) ⇒ BasePart
Returns a new instance of BasePart.
5
6
7
8
9
|
# File 'lib/pptx/opc/base_part.rb', line 5
def initialize(package, part_name)
@package = package
@part_name = part_name
package.set_part(part_name, self, content_type)
end
|
Instance Method Details
#base_xml ⇒ Object
11
12
13
|
# File 'lib/pptx/opc/base_part.rb', line 11
def base_xml
nil
end
|
#content_type ⇒ Object
15
16
17
|
# File 'lib/pptx/opc/base_part.rb', line 15
def content_type
nil
end
|
#doc ⇒ Object
19
20
21
|
# File 'lib/pptx/opc/base_part.rb', line 19
def doc
@doc ||= Nokogiri::XML(template || base_xml)
end
|
#marshal ⇒ Object
23
24
25
|
# File 'lib/pptx/opc/base_part.rb', line 23
def marshal
doc.to_s
end
|
#part_name ⇒ Object
27
28
29
|
# File 'lib/pptx/opc/base_part.rb', line 27
def part_name
@part_name
end
|
#template ⇒ Object
31
32
33
|
# File 'lib/pptx/opc/base_part.rb', line 31
def template
@package.template_part(@part_name)
end
|