Module: CGI::Html4

Defined in:
lib/rubysl/cgi/cgi.rb

Overview

Mixin module for HTML version 4 generation methods.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.element_init_methodsObject

Initialise the HTML generation methods for this version.



2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
# File 'lib/rubysl/cgi/cgi.rb', line 2150

def self.element_init_methods
  methods = ""
  # - -
  for element in %w[ TT I B BIG SMALL EM STRONG DFN CODE SAMP KBD
    VAR CITE ABBR ACRONYM SUB SUP SPAN BDO ADDRESS DIV MAP OBJECT
    H1 H2 H3 H4 H5 H6 PRE Q INS DEL DL OL UL LABEL SELECT OPTGROUP
    FIELDSET LEGEND BUTTON TABLE TITLE STYLE SCRIPT NOSCRIPT
    TEXTAREA FORM A BLOCKQUOTE CAPTION ]
    methods += "      def \#{element.downcase}(attributes = {})\n    BEGIN\n      end\n    END\n  end\n\n  # - O EMPTY\n  for element in %w[ IMG BASE BR AREA LINK PARAM HR INPUT COL META ]\n    methods += <<-BEGIN + TagMaker.nOE_element_def(element) + <<-END\n      def \#{element.downcase}(attributes = {})\n    BEGIN\n      end\n    END\n  end\n\n  # O O or - O\n  for element in %w[ HTML BODY P DT DD LI OPTION THEAD TFOOT TBODY\n      COLGROUP TR TH TD HEAD]\n    methods += <<-BEGIN + TagMaker.nO_element_def(element) + <<-END\n      def \#{element.downcase}(attributes = {})\n    BEGIN\n      end\n    END\n  end\n  eval(methods)\nend\n" + TagMaker.nn_element_def(element) + ""

Instance Method Details

#doctypeObject

The DOCTYPE declaration for this version of HTML



2141
2142
2143
# File 'lib/rubysl/cgi/cgi.rb', line 2141

def doctype
  %|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">|
end

#element_initObject



2145
2146
2147
# File 'lib/rubysl/cgi/cgi.rb', line 2145

def element_init
  # did this is the module body
end