Class: RubyPoint::App
- Inherits:
-
File
show all
- Defined in:
- lib/rubypoint/docProps/app.rb
Defined Under Namespace
Classes: Slide
Instance Attribute Summary
Attributes inherited from File
#file_path
Attributes inherited from Element
#objects, #parent, #presentation
Instance Method Summary
collapse
Methods inherited from File
#<<, #write
Methods inherited from Element
class_attributes
Constructor Details
#initialize(presentation) ⇒ App
Returns a new instance of App.
3
4
5
6
|
# File 'lib/rubypoint/docProps/app.rb', line 3
def initialize(presentation)
@presentation = presentation
@file_path = presentation.file_directory + "/docProps/app.xml"
end
|
Instance Method Details
#before_write ⇒ Object
8
9
10
11
12
|
# File 'lib/rubypoint/docProps/app.rb', line 8
def before_write
self.slides.each do |s|
self << Slide.new(s)
end
end
|
#doc ⇒ Object
18
19
20
|
# File 'lib/rubypoint/docProps/app.rb', line 18
def doc
@doc ||= Hpricot::XML(raw)
end
|
#raw ⇒ Object
22
23
24
25
26
27
|
# File 'lib/rubypoint/docProps/app.rb', line 22
def raw
raw = <<EOF
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><TotalTime>2</TotalTime><Words>8</Words><Application>Microsoft Macintosh PowerPoint</Application><PresentationFormat>On-screen Show (4:3)</PresentationFormat><Paragraphs>2</Paragraphs><Slides>#{self.slides.size}</Slides><Notes>0</Notes><HiddenSlides>0</HiddenSlides><MMClips>0</MMClips><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector size="4" baseType="variant"><vt:variant><vt:lpstr>Design Template</vt:lpstr></vt:variant><vt:variant><vt:i4>1</vt:i4></vt:variant><vt:variant><vt:lpstr>Slide Titles</vt:lpstr></vt:variant><vt:variant><vt:i4>#{self.slides.size}</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size="#{self.slides.size + 1}" baseType="lpstr"><vt:lpstr>Office Theme</vt:lpstr></vt:vector></TitlesOfParts><Company>Revelation</Company><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>12.0000</AppVersion></Properties>
EOF
end
|
#slides ⇒ Object
14
15
16
|
# File 'lib/rubypoint/docProps/app.rb', line 14
def slides
@presentation.slides
end
|