class HTML::Table::Head
This class represents an HTML
table head (<thead>). It is a subclass of Table::TableSection
. It is a singleton class.
Public Class Methods
create(arg=nil, &block)
click to toggle source
This is our constructor for Head
objects because it is a singleton class. Optionally, a block may be provided. If an argument is provided it is treated as content.
# File lib/html/head.rb, line 18 def self.create(arg=nil, &block) @@head = new(arg, &block) unless @@head @@head end
new(arg, &block)
click to toggle source
Called by create() instead of new(). This initializes the Head
class.
# File lib/html/head.rb, line 25 def initialize(arg, &block) @html_begin = "<thead" @html_end = "</thead>" instance_eval(&block) if block_given? self.content = arg if arg end