Class: TableParser::TableColumn

Inherits:
TableNode show all
Defined in:
lib/table_parser/table_column.rb

Instance Attribute Summary collapse

Attributes inherited from TableNode

#colspan, #element, #rowspan, #text

Instance Method Summary collapse

Methods inherited from TableNode

#span

Constructor Details

#initialize(element, rowspan = nil, colspan = nil) ⇒ TableColumn

Returns a new instance of TableColumn.



4
5
6
7
# File 'lib/table_parser/table_column.rb', line 4

def initialize(element, rowspan=nil, colspan=nil)
  super(element, rowspan, colspan)
  @children = []
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



3
4
5
# File 'lib/table_parser/table_column.rb', line 3

def children
  @children
end

Instance Method Details

#[](index) ⇒ Object



13
14
15
# File 'lib/table_parser/table_column.rb', line 13

def [](index)
  @children[index]
end

#sizeObject



9
10
11
# File 'lib/table_parser/table_column.rb', line 9

def size
  @children.size
end

#to_sObject



17
18
19
# File 'lib/table_parser/table_column.rb', line 17

def to_s
  "TableColumn<name=#{text}, children=#{@children.collect{|c| c.to_s }.join(",")}>"
end