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
Source
# File lib/html/head.rb, line 20 def self.create(arg = nil, &block) instance(arg, &block) end
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.
Source
# File lib/html/head.rb, line 26 def self.instance(arg = nil, &block) @instance ||= new(arg, &block) end
Part of the singleton interface.
Source
# File lib/html/head.rb, line 32 def initialize(arg, &block) @html_begin = '<thead' @html_end = '</thead>' super(&block) self.content = arg if arg end
Called by create() instead of new(). This initializes the Head
class.
Calls superclass method
HTML::Table::TableSection::new