Posts tagged: dynamic_rubyist

12 posts

Better Know A Ruby Thing: Method Lookup

## Notes and Corrections Before we get fully started here, a couple of notes on [Better Know Singleton Classes](https://noelrappin.com/blog/2025/01/better-know-a-ruby-thing-singleton-classes/), which, among other things, got mentioned on Hacker News, giving me comments there for the first time in years, maybe for the first time ever. One Hacker News comment suggested that...

Better Know A Ruby Thing: Singleton Classes

It is time to Better Know what is perhaps the Ruby-iest of Ruby things, a feature that didn't even have an official name for several years, despite being critical to Ruby's Object-Oriented semantics. (It only just now occurs to me that there was no official name _in English_, I wonder...

Better Know A Ruby Thing: On The Use of Private Methods

Last time around, we got to [Better Know access control in Ruby](https://noelrappin.com/blog/2024/05/better-know-access-control-part-1/), and I started to write my opinion on the use of private methods in Ruby, but my position/argument/rant had gotten out of hand and so I spun it off into its own post. This is that post. It’s...

Better Know A Ruby Thing: Methods and Access Control (part 1)

I’ll be honest, I picked this topic out of the half-dozen or so Better Know A Ruby Things on my to-do list strictly because it’s maybe the only Ruby take that I genuinely argue with people about. To be even more honest, it got away from me a bit as...

Conway’s Law

If your organization has coders continually getting in each other's way, or if you make a change to part of your code base and don’t know who needs to review it, or if you have code that nobody maintains because everybody owns it... you may be violating Conway’s Law. ---...

Better Know A Ruby Thing #5: Block Arguments

Previously in what what I guess is now “The Argument Trilogy”, we talked about: * [Positional Arguments](https://noelrappin.com/blog/2024/01/better-know-positional-arguments/) * [Keyword Arguments](https://noelrappin.com/blog/2024/02/better-know-keyword-arguments/) And now the trilogy now comes to its inevitable conclusion with ~~“Return of The Jedi”~~ block arguments. In the interest of keeping this thing within the plausible word count of...

Better Know A Ruby Thing #4: Keyword Arguments

Last time on Better Know A Ruby Thing, we covered positional arguments, and now we’re going to move on to keyword arguments. I really did think this was going to be shorter than the last one, and then I got to the conversion between keyword and positional arguments, and then......

Better Know A Ruby Thing #3: Positional Arguments

Ruby has three ways to pass information from a method call to a method definition: positional arguments, keyword arguments, and block arguments. Each of these ways has: * A syntax to declare an argument of that type in a method definition * A syntax to declare an argument of that...

How To Manage Duplicate Test Setup, or Can I Interest You In Weird RSpec?

You have a series of test cases. They cover the same logic with different inputs. In order to get to that logic, there’s some overhead: objects have to be created first. Then there's more logic needed to evaluate the result. What's the best way to manage these tests? You want...

Better Know A Ruby Thing Bonus: Contestants and Nesting

Sorry for skipping a week or two -- I was approving copyedits on the book that is now called [_Programming Ruby 3.3_](https://pragprog.com/titles/ruby5/), because we now want to be proactive about the next release. Coincidentally, the copyedit review does relate to this newsletter. I noticed a particular code sample as I...

Better Know A Ruby Thing #2: Constants

A fun thing about learning Ruby is that sometimes concepts that have the same name as in other languages have different behavior and purpose in Ruby. Today: constants They aren't actually constant. They aren't only used for small strings or magic literals. They aren't even mostly used for that in...

Better Know A Ruby Thing #1: method_missing

Welcome to "Better Know A Ruby Thing". In each one of these, we're going to look at some feature of Ruby language, library, ecosystem, or culture and explain what it does, how it works, why it's there, and any thing else that comes to mind. First up, `method_missing`. If I...
All Posts

Subscribe to the Dynamic Rubyist Newsletter

Subscribe to the blog via RSS

RSS Feed