Sha256: 16ca1c14af8490105d3b28021ead88172df36ea0058161ff21506834ee4cc948
Contents?: true
Size: 724 Bytes
Versions: 5
Compression:
Stored size: 724 Bytes
Contents
module Trickster class SlideParser attr_reader :title def initialize(lines,renderer) @lines = lines @renderer = renderer @title = @lines.shift end def body each_slide do |slide_type,content| @renderer.render_slide(slide_type,content) end @renderer.content end private def each_slide(&block) content = [] slide_type = nil @lines.each do |line| next if line =~ /^-- / if line =~/^!(.*)$/ block.call(slide_type,content) unless slide_type.nil? slide_type = $1 content = [] else content << line end end block.call(slide_type,content) end end end
Version data entries
5 entries across 5 versions & 1 rubygems