Prison 101: Explaining Ruby Variable Scope

17 Jun

There are four types of variables in Ruby: Local, Instance, Class, Global. If you’re confused by their scope or how to use them, check out the fun presentation by David Ladowitz below. It will make you laugh, I promise!

And, in case the slides were confusing, here is another great way to visualize variable scope from John Davison’s blog:
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