Ruby Block-Local Variable
Ruby’s variable-scoping rules can be a little surprising if you’re coming from a C-like language. Learn how to introduce variable “shadowing” to Ruby blocks, and why you might want to… or why you might not!
Ruby’s variable-scoping rules can be a little surprising if you’re coming from a C-like language. Learn how to introduce variable “shadowing” to Ruby blocks, and why you might want to… or why you might not!
Constants, globals, locals, instance variables, methods… Ruby has a lot of namespaces. Let’s learn about a Ruby power tool for reflecting on these names no matter what space they come from!
In a language full of expressive little shorthands, it’s time to meet a new idiom! This one makes simple blocks even more concise.
Learn how to use the power of Ruby’s Binding objects to take precise control of the environment code is executed within!
Ruby is all about giving coders choices. What if you could give users of your code the choice between positional or keyword arguments, or some mix of the two? Let’s learn how!
Learn about Ruby’s method introspection features while re-creating JavaScript’s parameter destructuring. Join guest chef Brandon Weaver for this mind- and language-expanding episode!
Now that you’ve learned how to obfuscate your code with Perl-style special variables, learn how to make it readable again!
Learn about one final category of Ruby’s Perl-style special variables, and some guidelines for using them.
Learn about Ruby’s Perl-style I/O special variables, and why they exist.
Some pointers on making your Ruby parameter defaults self-documenting.