Class: RubyPowerpoint::Presentation
- Inherits:
-
Object
- Object
- RubyPowerpoint::Presentation
- Defined in:
- lib/ruby_powerpoint/presentation.rb
Instance Attribute Summary collapse
-
#files ⇒ Object
readonly
Returns the value of attribute files.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(path) ⇒ Presentation
constructor
A new instance of Presentation.
- #slides ⇒ Object
Constructor Details
#initialize(path) ⇒ Presentation
Returns a new instance of Presentation.
10 11 12 13 |
# File 'lib/ruby_powerpoint/presentation.rb', line 10 def initialize path raise 'Not a valid file format.' unless (['.pptx'].include? File.extname(path).downcase) @files = Zip::File.open path end |
Instance Attribute Details
#files ⇒ Object (readonly)
Returns the value of attribute files.
8 9 10 |
# File 'lib/ruby_powerpoint/presentation.rb', line 8 def files @files end |
Instance Method Details
#close ⇒ Object
25 26 27 |
# File 'lib/ruby_powerpoint/presentation.rb', line 25 def close @files.close end |
#slides ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/ruby_powerpoint/presentation.rb', line 15 def = Array.new @files.each do |f| if f.name.include? 'ppt/slides/slide' .push RubyPowerpoint::Slide.new(self, f.name) end end .sort{|a,b| a. <=> b.} end |