Class: RhetButler::SlideRendering
- Inherits:
-
SlideTraverser
- Object
- SlideTraverser
- RhetButler::SlideRendering
- Defined in:
- lib/rhet-butler/slide-rendering.rb
Instance Attribute Summary collapse
-
#file_set ⇒ Object
Returns the value of attribute file_set.
-
#root_group ⇒ Object
Returns the value of attribute root_group.
Attributes inherited from SlideTraverser
Instance Method Summary collapse
Methods inherited from SlideTraverser
#ascend, #descend, #initialize, #on_group, #traverse
Constructor Details
This class inherits a constructor from RhetButler::SlideTraverser
Instance Attribute Details
#file_set ⇒ Object
Returns the value of attribute file_set.
5 6 7 |
# File 'lib/rhet-butler/slide-rendering.rb', line 5 def file_set @file_set end |
#root_group ⇒ Object
Returns the value of attribute root_group.
5 6 7 |
# File 'lib/rhet-butler/slide-rendering.rb', line 5 def root_group @root_group end |
Instance Method Details
#filter_text(content, filters) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rhet-butler/slide-rendering.rb', line 21 def filter_text(content, filters) case content when String filters.inject(content) do |text, filter| filter.process(text) end when Array content.map{|item| filter_text(item, filters)}.join("") when SlideContents filter_text(content.content(file_set), content.filters) else raise "Don't know how to filter slide content like #{content.inspect}" end end |
#on_slide(slide) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/rhet-butler/slide-rendering.rb', line 11 def () .content = filter_text(.raw_content, .content_filters) .notes = filter_text(.raw_notes, .note_filters) raise "Slide content needs to be a string, was: #{.content.inspect}" unless String === .content raise "Slide notes needs to be a string, was: #{.notes.inspect}" unless String === .notes rescue puts "While processing #{}:" raise end |
#setup ⇒ Object
7 8 9 |
# File 'lib/rhet-butler/slide-rendering.rb', line 7 def setup descend(@root_group, @root_group) end |