Class: Konjac::Office::Mac::PowerPoint
- Defined in:
- lib/konjac/office/mac/power_point.rb
Overview
PowerPoint for Mac
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#active_document ⇒ Object
Retrieves the active document and caches it.
-
#data ⇒ Object
Creates a dump of the spreadsheet’s data in Tag form.
-
#initialize(path = nil) ⇒ PowerPoint
constructor
Creates a new PowerPoint object.
-
#size ⇒ Object
(also: #length)
Retrieves the number of cells in the document.
Methods inherited from Shared
Methods inherited from Base
#[], #[]=, #export, #import, #read, #shape_at, #tags, #write
Constructor Details
#initialize(path = nil) ⇒ PowerPoint
Creates a new PowerPoint object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/konjac/office/mac/power_point.rb', line 8 def initialize(path = nil) super "Microsoft PowerPoint", path @strippable = // @parse_order = [:slide, :shape] @item_opts.merge!({ :ref_path => [:slide, :shape], :content_path => [:text_frame, :text_range, :content], :strippable => // }) @shape_opts = @item_opts end |
Instance Method Details
#active_document ⇒ Object
Retrieves the active document and caches it
21 22 23 |
# File 'lib/konjac/office/mac/power_point.rb', line 21 def active_document @active_document ||= @application.active_presentation end |
#data ⇒ Object
Creates a dump of the spreadsheet’s data in Tag form
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/konjac/office/mac/power_point.rb', line 26 def data = [] @document..get.each_with_index do |, sl| .shapes.get.each_with_index do |shape, sh| temp = Tag.new temp.indices = [sl + 1, sh + 1] temp.removed = temp.added = read(sl + 1, sh + 1) << temp unless temp.blank? end end end |
#size ⇒ Object Also known as: length
Retrieves the number of cells in the document. Note that this method fetches all row and column elements and can thus be very expensive for large spreadsheets.
42 43 |
# File 'lib/konjac/office/mac/power_point.rb', line 42 def size end |