A handy ruby trick: Class.new

Today I learned that you can pass a block to Class.new, like so: klass = Class.new do   def self.speak     "hi!"   end end >> klass.speak => "hi! This is a handy for creating one-off classes; the kind you’ll throw away quickly. It’s likely that you’d do this during tests. Here’s a test [...]