From: Mike Austin Date: 2010-04-15T12:45:12+09:00 Subject: Safer monkey-patching? Sometimes (or often, depending on your use) it is useful to add or override methods to an already existing class, aka monkey-patching. Would it be useful to subclass an existing object, while still using the same class-name - in essence, creating an extended local version of the class: String = Class.new(String) do def size() return -1 end end string = String.new << "foo" puts string.size I realize this is re-assigning a constant, but it's more for demonstration purposes. Now anything within lexical scope will use the new class, while other methods will use the original. Mike