lib/slide_hero/point.rb in slide_hero-0.0.9 vs lib/slide_hero/point.rb in slide_hero-0.0.10
- old
+ new
@@ -1,25 +1,22 @@
module SlideHero
class Point
+ include Compilable
attr_reader :text
- SUPPORTED_ANIMATIONS = %w{grow shrink roll-in fade-out
+ SUPPORTED_ANIMATIONS = %w{grow shrink roll-in fade-out
highlight-red highlight-green highlight-blue}
def initialize(text, animation: nil)
@text = text
@animation = animation
end
- def compile
- "<p#{animation}>#{text}</p>"
- end
-
private
def animation
if @animation
- animation_markup = ' class="fragment '
+ animation_markup = ' class="fragment '
if SUPPORTED_ANIMATIONS.include? @animation
- animation_markup << @animation
+ animation_markup << @animation
end
animation_markup + "\""
end
end
end