Class: HTMLTableCell

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

Instance Method Summary collapse

Constructor Details

#initialize(str, n, h) ⇒ HTMLTableCell

Returns a new instance of HTMLTableCell.



129
130
131
132
133
134
135
136
137
138
139
# File 'lib/zarchitect/htmltable.rb', line 129

def initialize(str,n,h)
  @content = str
  @colspan = n
  @headerf = h
  @html = String.new
  if @headerf
    @html << "<th colspan=\"#{@colspan}\">"
  else
    @html << "<td colspan=\"#{@colspan}\">"
  end
end

Instance Method Details

#htmlObject



150
151
152
# File 'lib/zarchitect/htmltable.rb', line 150

def html
  @html
end

#processObject



141
142
143
144
145
146
147
148
# File 'lib/zarchitect/htmltable.rb', line 141

def process
  @html << @content
  if @headerf
    @html << "</th>"
  else
    @html << "</td>"
  end
end