Class: HTML::Table::TableSection

Inherits:
Array
  • Object
show all
Includes:
AttributeHandler, HtmlHandler
Defined in:
lib/html/tablesection.rb

Overview

Superclass for THEAD, TBODY, TFOOT

Direct Known Subclasses

Table::Body, Table::Foot, Table::Head

Class Method Summary collapse

Instance Method Summary collapse

Methods included from HtmlHandler

#html

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(&block) ⇒ TableSection

Returns a new instance of TableSection.



8
9
10
# File 'lib/html/tablesection.rb', line 8

def initialize(&block)
   instance_eval(&block) if block_given?
end

Class Method Details

.indent_levelObject



20
21
22
# File 'lib/html/tablesection.rb', line 20

def self.indent_level
   @indent_level
end

.indent_level=(num) ⇒ Object

Raises:

  • (ArgumentError)


24
25
26
27
28
# File 'lib/html/tablesection.rb', line 24

def self.indent_level=(num)
   expect(num, Integer)
   raise ArgumentError, "indent_level must be >= 0" if num < 0
   @indent_level = num
end

Instance Method Details

#[]=(index, obj) ⇒ Object



30
31
32
33
# File 'lib/html/tablesection.rb', line 30

def []=(index,obj)
   expect(obj,Table::Row)
   super
end

#content=(arg) ⇒ Object

Adds a Table::Row object as content. The arg is passed as the value to the Table::Row constructor.



15
16
17
18
# File 'lib/html/tablesection.rb', line 15

def content=(arg)
   tr = Table::Row.new(arg)
   self.push(tr)
end

#push(*args) ⇒ Object



35
36
37
38
# File 'lib/html/tablesection.rb', line 35

def push(*args)
   args.each{ |obj| expect(obj,Table::Row) }
   super
end

#unshift(obj) ⇒ Object



40
41
42
43
# File 'lib/html/tablesection.rb', line 40

def unshift(obj)
   expect(obj,Table::Row)
   super
end