class Rabbit::Element::Table
Attributes
caption[R]
Public Class Methods
new(prop={})
click to toggle source
Calls superclass method
Rabbit::Element::ContainerElement::new
# 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
Public Instance Methods
body()
click to toggle source
# File lib/rabbit/element/table.rb, line 23 def body elements.find {|e| e.is_a?(TableBody)} end
head()
click to toggle source
# File lib/rabbit/element/table.rb, line 19 def head elements.find {|e| e.is_a?(TableHead)} end
text()
click to toggle source
Calls superclass method
Rabbit::Element::ContainerElement#text
# File lib/rabbit/element/table.rb, line 28 def text result = '' result << "#{@caption}\n" if @caption result << super result end
Also aliased as: container_text
to_html(generator)
click to toggle 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
to_rd()
click to toggle 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