module SlideHero class List attr_reader :style def initialize(style=:unordered, &block) @style = style instance_eval(&block) end def compile gem_path = Gem.loaded_specs['slide_hero'].full_gem_path if style == :unordered Tilt::ERBTemplate.new(File.join(gem_path, 'lib/slide_hero/views/unordered_list.html.erb')).render(self) else Tilt::ERBTemplate.new(File.join(gem_path, 'lib/slide_hero/views/ordered_list.html.erb')).render(self) end end def point(text, animation: nil) points << ListPoint.new(text, { animation: animation }) end def points @points ||= [] end end end