Sha256: 70b3f56150114365aa2f6da316138a6312f64b72597793b49cdea1e93bf96ae1

Contents?: true

Size: 846 Bytes

Versions: 38

Compression:

Stored size: 846 Bytes

Contents

require 'rabbit/element/slide-element'
require 'rabbit/element/text-block-element'

module Rabbit
  module Element
    class Slide
      include SlideElement

      def initialize(title)
        super
      end

      def headline
        @elements[0]
      end

      def body
        @elements[1]
      end

      def to_html(generator)
        "<div class=\"slide\">\n#{super}\n</div>"
      end

      def hide_title?
        self["hide-title"] == "true"
      end
    end

    class HeadLine
      include TextBlockElement

      def to_rd
        "= #{text}"
      end

      def to_html(generator)
        "<h1>#{super}</h1>"
      end

      def draw_elements(canvas, x, y, w, h, simulation)
        return [x, y, w, h] if slide.hide_title?
        super
      end
    end

    class Body
      include ContainerElement
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
rabbit-3.0.3 lib/rabbit/element/slide.rb
rabbit-3.0.2 lib/rabbit/element/slide.rb
rabbit-3.0.1 lib/rabbit/element/slide.rb
rabbit-3.0.0 lib/rabbit/element/slide.rb
rabbit-2.2.1 lib/rabbit/element/slide.rb
rabbit-2.2.0 lib/rabbit/element/slide.rb
rabbit-2.1.9 lib/rabbit/element/slide.rb
rabbit-2.1.8 lib/rabbit/element/slide.rb
rabbit-2.1.7 lib/rabbit/element/slide.rb
rabbit-2.1.6 lib/rabbit/element/slide.rb
rabbit-2.1.5 lib/rabbit/element/slide.rb
rabbit-2.1.4 lib/rabbit/element/slide.rb
rabbit-2.1.3 lib/rabbit/element/slide.rb
rabbit-2.1.2 lib/rabbit/element/slide.rb
rabbit-2.1.1 lib/rabbit/element/slide.rb
rabbit-2.1.0 lib/rabbit/element/slide.rb
rabbit-2.0.9 lib/rabbit/element/slide.rb
rabbit-2.0.8 lib/rabbit/element/slide.rb
rabbit-2.0.7 lib/rabbit/element/slide.rb
rabbit-2.0.6 lib/rabbit/element/slide.rb