Is there a way to make a temporary class within a method? It does not have to actually be a class, it could be an object instance with 2 methods added to it.