Class: PowerPointPptx::Slide
- Inherits:
-
Object
- Object
- PowerPointPptx::Slide
- Defined in:
- lib/power_point_pptx/slide.rb
Overview
Represents a slide in a PowerPoint presentation.
Instance Attribute Summary collapse
-
#entry_name ⇒ Object
readonly
Returns the value of attribute entry_name.
-
#parsed_xml ⇒ Object
readonly
Returns the value of attribute parsed_xml.
-
#xml ⇒ Object
Returns the value of attribute xml.
Instance Method Summary collapse
- #content ⇒ Object
- #content=(content) ⇒ Object
-
#initialize(entry, entry_name) ⇒ Slide
constructor
A new instance of Slide.
Constructor Details
#initialize(entry, entry_name) ⇒ Slide
Returns a new instance of Slide.
11 12 13 14 15 |
# File 'lib/power_point_pptx/slide.rb', line 11 def initialize(entry, entry_name) @entry_name = entry_name @xml = entry.get_input_stream.read @parsed_xml = Nokogiri::XML::Document.parse @xml end |
Instance Attribute Details
#entry_name ⇒ Object (readonly)
Returns the value of attribute entry_name.
8 9 10 |
# File 'lib/power_point_pptx/slide.rb', line 8 def entry_name @entry_name end |
#parsed_xml ⇒ Object (readonly)
Returns the value of attribute parsed_xml.
8 9 10 |
# File 'lib/power_point_pptx/slide.rb', line 8 def parsed_xml @parsed_xml end |
#xml ⇒ Object
Returns the value of attribute xml.
8 9 10 |
# File 'lib/power_point_pptx/slide.rb', line 8 def xml @xml end |
Instance Method Details
#content ⇒ Object
17 18 19 |
# File 'lib/power_point_pptx/slide.rb', line 17 def content parsed_xml.xpath("//a:t").collect(&:text) end |
#content=(content) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/power_point_pptx/slide.rb', line 21 def content=(content) parsed_xml.xpath("//a:t").each_with_index do |node, index| node.content = content[index] end @xml = parsed_xml.to_xml end |