class Rabbit::Element::TitleSlide

Public Instance Methods

<<(element) click to toggle source
Calls superclass method
# File lib/rabbit/element/title-slide.rb, line 10
def <<(element)
  return unless element.is_a?(DescriptionList)
  element.each do |item|
    name = item.term.collect{|x| x.text}.join("")
    name = normalize_name(name)
    klass_name = to_class_name(name)
    if Element.const_defined?(klass_name)
      meta = Element.const_get(klass_name).new
      item.content.each do |elem|
        elem.each do |e|
          meta << e
        end
      end
      super(meta)
    else
      content = ""
      item.content.each do |x|
        content << x.text
      end
      self[name] = content.strip
    end
  end
end
allotted_time() click to toggle source
# File lib/rabbit/element/title-slide.rb, line 38
def allotted_time
  self["allotted-time"]
end
end_time() click to toggle source
# File lib/rabbit/element/title-slide.rb, line 46
def end_time
  self["end-time"]
end
start_time() click to toggle source
# File lib/rabbit/element/title-slide.rb, line 42
def start_time
  self["start-time"]
end
theme() click to toggle source
# File lib/rabbit/element/title-slide.rb, line 34
def theme
  self["theme"]
end
title() click to toggle source
Calls superclass method Rabbit::Element::SlideElement#title
# File lib/rabbit/element/title-slide.rb, line 54
def title
  sub_title = find {|element| element.is_a?(Subtitle)}
  sub_title = sub_title.text if sub_title
  [super, sub_title].compact.join(" - ")
end
to_html(generator) click to toggle source
# File lib/rabbit/element/title-slide.rb, line 50
def to_html(generator)
  "<div class=\"title-slide\">\n#{super}\n</div>"
end

Private Instance Methods

normalize_name(name) click to toggle source
# File lib/rabbit/element/title-slide.rb, line 61
def normalize_name(name)
  name.gsub(/_/, "-").strip
end