Question: I want to create a function that messes around with the classes passed to it. What would be the most idiomatic way to reopen those classes to add functionality? Here's what I mean:

```
def class_messer(target_object)
  #would like to reopen class here with something like:
  class target_object.class
    #add methods
  end
end

```

Obviously that syntax doesn't work. I could get the target\_object's class and eval some strings, but that feels gross. Is there a more idiomatic way to do this?

Answer: 
```
target_object.class.class_exec do
  # add methods
end

```
You can also do this:

```
class << target_object.class

end

```