Sha256: 1c20ac9d6c38fd75ee18a8fe8758d3324d661e05481d046ea94299cbf5fe2c24

Contents?: true

Size: 533 Bytes

Versions: 6

Compression:

Stored size: 533 Bytes

Contents

module SlideHero
  class GroupedSlides
    def initialize(slide_defaults={}, &block)
      @slide_defaults = slide_defaults
      instance_eval(&block)
    end

    def compile
      Tilt::ERBTemplate.
        new(File.join(SlideHero.template_path, 
                      'lib/slide_hero/views/grouped_slides.html.erb')).render(self)
    end

    def slide(headline, **kwargs, &block)
      slides << Slide.new(headline, @slide_defaults.merge(**kwargs), &block).compile
    end

    def slides
      @slides ||= []
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
slide_hero-0.0.9 lib/slide_hero/grouped_slides.rb
slide_hero-0.0.8 lib/slide_hero/grouped_slides.rb
slide_hero-0.0.7 lib/slide_hero/grouped_slides.rb
slide_hero-0.0.6 lib/slide_hero/grouped_slides.rb
slide_hero-0.0.5 lib/slide_hero/grouped_slides.rb
slide_hero-0.0.4 lib/slide_hero/grouped_slides.rb