Class: SlideHero::GroupedSlides
- Inherits:
-
Object
- Object
- SlideHero::GroupedSlides
- Defined in:
- lib/slide_hero/grouped_slides.rb
Instance Method Summary collapse
- #compile ⇒ Object
-
#initialize(slide_defaults = {}, &block) ⇒ GroupedSlides
constructor
A new instance of GroupedSlides.
- #slide(headline, **kwargs, &block) ⇒ Object
- #slides ⇒ Object
Constructor Details
#initialize(slide_defaults = {}, &block) ⇒ GroupedSlides
Returns a new instance of GroupedSlides.
3 4 5 6 |
# File 'lib/slide_hero/grouped_slides.rb', line 3 def initialize(={}, &block) @slide_defaults = instance_eval(&block) end |
Instance Method Details
#compile ⇒ Object
8 9 10 11 12 |
# File 'lib/slide_hero/grouped_slides.rb', line 8 def compile Tilt::ERBTemplate. new(File.join(SlideHero.template_path, 'lib/slide_hero/views/grouped_slides.html.erb')).render(self) end |
#slide(headline, **kwargs, &block) ⇒ Object
14 15 16 |
# File 'lib/slide_hero/grouped_slides.rb', line 14 def (headline, **kwargs, &block) << Slide.new(headline, @slide_defaults.merge(**kwargs), &block).compile end |
#slides ⇒ Object
18 19 20 |
# File 'lib/slide_hero/grouped_slides.rb', line 18 def @slides ||= [] end |