Class Methods Considered Annoying
Challenge: given the following class, write a method #find_like_objects which will call the class method .find with attributes. class Foo attr_reader :attributes def initialize @attributes = { :bar => 42…
Challenge: given the following class, write a method #find_like_objects which will call the class method .find with attributes. class Foo attr_reader :attributes def initialize @attributes = { :bar => 42…
Reading through the Rake source code the other day (a pastime I highly recommend), I was reminded of a technique I don’t use often enough: my_array = [:foo, :bar, :baz]…
The third part of my Ruby subprocesses series just went up over at the Devver blog. In it I cover the Open3, PTY, and Shell standard libraries.
When spec-ing something that calls method which takes a set of nested hashes (as many Rails methods do), it may be tempting to use #hash_including: to test for only the…
In Ruby, the typical way to define a class is using the class keyword: class Foo # … end The class keyword, however, is effectively just syntax sugar for the…
It’s an oft-stated fact that most disasters result not from a single point of failure but from a combination of failures reinforcing each other. I wouldn’t term the problem I…
Working as I do in the Rails world these days, I’m periodically reminded of the difference between me and most Rails programmers. That is, the fact that I came to…
The first technique we’ll look at in this series is something so basic it may not even seem worth spelling out. But sometimes old-school techniques are overlooked in the excitement…