Class: Middleman::Presentation::SlideGroup
- Inherits:
-
Object
- Object
- Middleman::Presentation::SlideGroup
- Defined in:
- lib/middleman-presentation-core/slide_group.rb
Overview
A group of slides
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#slides ⇒ Object
readonly
Returns the value of attribute slides.
Instance Method Summary collapse
-
#initialize(name:, slides:, template:) ⇒ SlideGroup
constructor
A new instance of SlideGroup.
-
#partial_path ⇒ Object
Combine paths of all slides.
-
#render(&block) ⇒ Object
Call block for each slide.
Constructor Details
#initialize(name:, slides:, template:) ⇒ SlideGroup
Returns a new instance of SlideGroup.
14 15 16 17 18 |
# File 'lib/middleman-presentation-core/slide_group.rb', line 14 def initialize(name:, slides:, template:) @name = name @slides = @template = template end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/middleman-presentation-core/slide_group.rb', line 12 def name @name end |
#slides ⇒ Object (readonly)
Returns the value of attribute slides.
12 13 14 |
# File 'lib/middleman-presentation-core/slide_group.rb', line 12 def @slides end |
Instance Method Details
#partial_path ⇒ Object
Combine paths of all slides
21 22 23 |
# File 'lib/middleman-presentation-core/slide_group.rb', line 21 def partial_path .map(&:partial_path).to_list end |
#render(&block) ⇒ Object
Call block for each slide
26 27 28 29 30 |
# File 'lib/middleman-presentation-core/slide_group.rb', line 26 def render(&block) = .each_with_object([]) { |e, a| a << e.render(&block) }.join("\n") template.result(slides: ) end |