Class: PowerPointer::Slide
- Inherits:
-
Object
- Object
- PowerPointer::Slide
- Defined in:
- lib/powerpointer/slide.rb
Instance Method Summary collapse
- #export_xml(folder, presentation, package) ⇒ Object
- #get_id ⇒ Object
- #get_relationship_id ⇒ Object
-
#initialize(slideId) ⇒ Slide
constructor
A new instance of Slide.
Constructor Details
#initialize(slideId) ⇒ Slide
Returns a new instance of Slide.
3 4 5 6 7 8 9 |
# File 'lib/powerpointer/slide.rb', line 3 def initialize() @slideId = @relationshipId = "rId_slide" + .to_s @filename = "slide#{@slideId}.xml" @relationships = Relationships.new @filename end |
Instance Method Details
#export_xml(folder, presentation, package) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/powerpointer/slide.rb', line 11 def export_xml(folder, presentation, package) # Export me export = ExportFile.new(folder + "slides/", @filename) export << XML_HEADER export << "<p:sld xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\">" export << "</p:sld>" package.add export # Add references to me presentation.get_relationships.add(@relationshipId, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide", "slides/#{export.get_filename}") c = ContentTypes::Override.new(export.get_full_path, "application/vnd.openxmlformats-officedocument.presentationml.slide+xml") package.add_content_type(c) # Export relationships @relationships.export_xml(export.get_path, package) end |
#get_id ⇒ Object
28 29 30 |
# File 'lib/powerpointer/slide.rb', line 28 def get_id @slideId end |
#get_relationship_id ⇒ Object
32 33 34 |
# File 'lib/powerpointer/slide.rb', line 32 def get_relationship_id @relationshipId end |