Sha256: 073fdc922d1428cf5d565db6793011c49ebd30176af87d27aeb25c2f1d11c7c8

Contents?: true

Size: 782 Bytes

Versions: 12

Compression:

Stored size: 782 Bytes

Contents

module Slideshow

  class Slide < Struct.new(:header, :content, :classes)
  
    def to_classic_html
       
      buf  = ""
      buf << "<div class='slide "
      buf << classes    if classes
      buf << "'>\n"      
      
      buf << header     if header
      buf << content    if content
      
      buf << "</div>\n"
      buf       
    end
    
    def to_google_html5
      
      buf  = ""
      buf << "<div class='slide'>\n"      

      if header
        buf << "<header>#{header}</header>\n"
      end
      
      buf << "<section class='"
      buf << classes      if classes      
      buf << "'>\n"
      
      buf << content      if content
      buf << "</section>\n"
      buf << "</div>\n"
      buf
    end
  
  end # class slide

end # module Slideshow

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
slideshow-0.9.11 lib/slideshow/slide.rb
slideshow-0.9.10 lib/slideshow/slide.rb
slideshow-0.9.9 lib/slideshow/slide.rb
slideshow-0.9.8 lib/slideshow/slide.rb
slideshow-0.9.7 lib/slideshow/slide.rb
slideshow-0.9.6 lib/slideshow/slide.rb
slideshow-0.9.5 lib/slideshow/slide.rb
slideshow-0.9.4 lib/slideshow/slide.rb
slideshow-0.9.3 lib/slideshow/slide.rb
slideshow-0.9.2 lib/slideshow/slide.rb
slideshow-0.9.1 lib/slideshow/slide.rb
slideshow-0.9 lib/slideshow/slide.rb