Fixing the Poignant Guide

There’s a problem here in the Poignant Guide to Ruby, where a variable appears to go missing when loaded in a separate code file (using the ‘require’ command). In short, it’s because local variables always go out of scope when a file is loaded or required, and the best solution I can see is to Capitalize the variable, making it a constant, as suggested here. Note also that the author’s suggestion that the Poignant Guide has been corrected in the ‘final’ version does not seem to be true, since the version he points to still has the same error.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: