Prev | Current Page 356 | Next

David Berube

"Practical Reporting with Ruby and Rails"


CHAPTER 12 n CREATING REPORTS WITH RUBY AND MICROSOFT OFFICE 257
nNote As noted in Chapter 11, a URL and a URI are the same in almost all situations you are likely to
encounter. All URLs are URIs, and while some URIs are not URLs, most are, and the difference is rarely
important even in academic contexts. You can find out more about URIs at http://en.wikipedia.org/
wiki/Uniform_Resource_Identifier.
At this point, the grades variable looks something like this:
[{"grade"=>["88"],
"student"=>["Bob Smithye"],
"class"=>["Practical Exopaleontology"],
"employer"=>["Transmegtech"],
"id"=>["25"],
"took_class_at"=>["Wed Nov 07 00:00:00 -0500 2011"]},
{"grade"=>["83"],
"student"=>["John Tumblewood"],
"class"=>["Practical Exopaleontology"],
"employer"=>["Elexagijitech"],
"id"=>["26"],
"took_class_at"=>["Wed Nov 07 00:00:00 -0500 2011"]},
. . .
The grades variable is an array of hashes. Each value of the resultant hash is an array,
even though they are all single values. This is because although each row will have only
one id, one grade, and so forth, that isn??™t evident from the XML.


Pages:
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368
Ricky Martin Robert Miles bronie w metin2 elf bot skrypty Men At Work