class Rabbit::Element::Table
Attributes
Public Class Methods
Source
# File lib/rabbit/element/table.rb, line 12 def initialize(prop={}) super() %w(caption).each do |name| instance_variable_set("@#{name}", prop[name]) end end
Calls superclass method
Rabbit::Element::ContainerElement::new
Public Instance Methods
Source
# File lib/rabbit/element/table.rb, line 23 def body elements.find {|e| e.is_a?(TableBody)} end
Source
# File lib/rabbit/element/table.rb, line 19 def head elements.find {|e| e.is_a?(TableHead)} end
Source
# File lib/rabbit/element/table.rb, line 28 def text result = '' result << "#{@caption}\n" if @caption result << super result end
Calls superclass method
Rabbit::Element::ContainerElement#text
Also aliased as: container_text
Source
# File lib/rabbit/element/table.rb, line 43 def to_html(generator) caption = nil caption = "<caption>#{@caption}</caption>\n" if @caption "<table>\n#{caption}#{super}\n</table>" end
Source
# File lib/rabbit/element/table.rb, line 35 def to_rd result = "# RT\n" result << "caption = #{@caption}\n" if @caption result << "\n" result << container_text result.gsub(/^/, " ") end