Class: HTMLTableRow

Inherits:
Object
  • Object
show all
Defined in:
lib/zarchitect/htmltable.rb

Instance Method Summary collapse

Constructor Details

#initialize(ar, ar2) ⇒ HTMLTableRow

Returns a new instance of HTMLTableRow.



96
97
98
99
100
101
102
# File 'lib/zarchitect/htmltable.rb', line 96

def initialize(ar,ar2)
  @contents = ar
  @colspans = ar2
  @headerf = false
  @columns = Array.new
  @html = "<tr>"
end

Instance Method Details

#htmlObject



108
109
110
# File 'lib/zarchitect/htmltable.rb', line 108

def html
  @html
end

#processObject



112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/zarchitect/htmltable.rb', line 112

def process
  @contents.each_with_index do |str,i|
    next if @colspans[i] == 0
    @columns.push HTMLTableCell.new(str,@colspans[i], @headerf)
  end
  @columns.each do |c|
    c.process
    @html << c.html
  end

  @html << "</tr>"
end

#set_headerObject



104
105
106
# File 'lib/zarchitect/htmltable.rb', line 104

def set_header
  @headerf = true
end