require 'rabbit/element/text-container-element' require 'rabbit/element/container-element' require 'rabbit/element/block-element' module Rabbit module Element class Table include ContainerElement include BlockElement attr_reader :caption def initialize(prop={}) super() %w(caption).each do |name| instance_variable_set("@#{name}", prop[name]) end end def head elements.find {|e| e.is_a?(TableHead)} end def body elements.find {|e| e.is_a?(TableBody)} end alias container_text text def text result = '' result << "#{@caption}\n" if @caption result << super result end def to_rd result = "# RT\n" result << "caption = #{@caption}\n" if @caption result << "\n" result << container_text result.gsub(/^/, " ") end def to_html(generator) caption = nil caption = "