While working on the atom.builder part of generating a feed, the next snippet confused me a bit:
entry.author do |author| entry.name order.name entry.email order.email end
Given the label author of the first line I expected this to be used to invoke the name and email methods, but instead they were invoked on the entry itself. Strangely enough this code does seem to be working.
I’ve also tried the code I expected:
entry.author do |author| author.name order.name author.email order.email end
and this works as well.I’m a bit confused what is supposed to be the correct piece now. The first (taken from the book)? If so, then why does it have that seemingly unused author part in it? The second? If so, then why does the first one work as well?