Sha256: f9973176ab1ad8b26297de45b26ba1853c08d8e7dc7e226694fbc6c0be1abd8f

Contents?: true

Size: 548 Bytes

Versions: 2

Compression:

Stored size: 548 Bytes

Contents

module SlideHero
  class Point
    include Compilable
    attr_reader :text
    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

    private
    def animation
      if @animation
        animation_markup = ' class="fragment '
        if SUPPORTED_ANIMATIONS.include? @animation
          animation_markup << @animation
        end
        animation_markup + "\""
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
slide_hero-0.0.11 lib/slide_hero/point.rb
slide_hero-0.0.10 lib/slide_hero/point.rb