Class: HTML::Table::Caption
- Inherits:
-
Object
- Object
- HTML::Table::Caption
- Includes:
- AttributeHandler, HtmlHandler
- Defined in:
- lib/html/caption.rb
Overview
This class represents an HTML Caption. Despite the name, it is not a subclass of Table. Note that end tags for this class are mandatory.
Class Method Summary collapse
-
.indent_level ⇒ Object
Returns the number of spaces that tags for this class are indented.
-
.indent_level=(num) ⇒ Object
Sets the number of spaces that tags for this class are indented.
Instance Method Summary collapse
-
#content=(arg) ⇒ Object
Adds content to the Table::Caption object.
-
#initialize(arg = nil, &block) ⇒ Caption
constructor
Returns a new Table::Caption object.
Methods included from HtmlHandler
Methods included from AttributeHandler
#abbr, #abbr=, #align, #align=, #axis, #axis=, #background, #background=, #bgcolor, #bgcolor=, #border, #border=, #bordercolor, #bordercolor=, #bordercolordark, #bordercolordark=, #bordercolorlight, #bordercolorlight=, #cellpadding, #cellpadding=, #cellspacing, #cellspacing=, #char, #char=, #charoff, #charoff=, #class_, #class_=, #col, #col=, #colspan, #colspan=, #configure, #content, #frame, #frame=, #height, #height=, #hspace, #hspace=, #nowrap, #nowrap=, #rowspan, #rowspan=, #rules, #rules=, #span, #span=, #style, #style=, #summary, #summary=, #valign, #valign=, #vspace, #vspace=, #width, #width=
Constructor Details
#initialize(arg = nil, &block) ⇒ Caption
Returns a new Table::Caption object. Optionally takes a block. If an argument is provided it is treated as content.
16 17 18 19 20 21 22 |
# File 'lib/html/caption.rb', line 16 def initialize(arg = nil, &block) @html_begin = '<caption' @html_body = '' @html_end = '</caption>' instance_eval(&block) if block_given? self.content = arg if arg end |
Class Method Details
.indent_level ⇒ Object
Returns the number of spaces that tags for this class are indented. For the Table::Caption class, the indention level defaults to 3.
34 35 36 |
# File 'lib/html/caption.rb', line 34 def self.indent_level @indent_level end |
.indent_level=(num) ⇒ Object
Sets the number of spaces that tags for this class are indented.
40 41 42 43 44 |
# File 'lib/html/caption.rb', line 40 def self.indent_level=(num) expect(num,Integer) raise ArgumentError, "indent level must be >= 0" if num < 0 @indent_level = num end |