class HTML::Table::Row::Header
This class represents an HTML
table header (<th>). Despite the name it is not a subclass of Table
or Table::Row
.
Public Class Methods
Source
# File lib/html/header.rb, line 38 def self.indent_level @indent_level end
Returns the indentation level for the tags of this class. The default is 6.
Source
# File lib/html/header.rb, line 45 def self.indent_level=(num) expect(num, Integer) raise ArgumentError, 'indent_level must be >= 0' if num < 0 @indent_level = num end
Sets the indentation level for the tags of this class. The default is 6.
Source
# File lib/html/header.rb, line 20 def initialize(arg = nil, &block) @html_begin = '<th' @html_body = '' @html_end = '</th>' instance_eval(&block) if block_given? self.content = arg if arg end
Creates and returns a new Header
object. Optionally takes a block. If an argument is provided, it is treated as content.
Public Instance Methods
Source
# File lib/html/header.rb, line 30 def content=(arg) arg = arg.is_a?(Array) ? arg.join : arg.to_s @html_body = Table::Content.new(arg) end
Adds content to the Table::Row::Header
object.