Prev | Current Page 182 | Next

David Berube

"Practical Reporting with Ruby and Rails"


\vspace{0.1in} % Add a small amount of
% whitespace between the
% header and the table.
\normalsize % Switch back to normal size.
\begin{tabular}{llll} % Start a table with four
% left aligned columns.
\textbf{Item}& % Four headers, each in bold,
\textbf{Seller}& % with labels for each column.
\textbf{Count}&
\textbf{Average Price}\\\\
'
The string in this code is a header for the LaTeX file. It contains a header with big
text, a vertical space, and then a table with four columns. You can see a brief explanation
of each element in the code comments. (The % symbol is a comment character in LaTeX,
which is why each comment begins with a %.)
Next, you loop through each keyword and seller and print out a single row for each
keyword/seller combination, as follows:
keywords.each do |keyword|
first=true
sellers.each do |seller|
total_items, average_price = *EBaySearch.get_average_price(keyword, seller)
CHAPTER 6 n TRACKING AUCTIONS WITH EBAY 129
latex_source << "
\\textbf{#{first ? keyword.latex_escape : ' '}} &
#{seller ? seller.


Pages:
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
ATB Powermed podl ubezpieczenia Leona Lewis