stole macro from Ruby 2.0