# The Old Switcharoo

**URL:** <https://www.ruby-forum.com/t/the-old-switcharoo/66992>\
**Category:** Ruby\
**Created:** [August 30, 2006, 8:21pm UTC](https://www.ruby-forum.com/t/the-old-switcharoo/66992 "2006-08-30T20:21:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/dfb087/32.png) [@Trans](https://www.ruby-forum.com/u/Trans)\
**Post date:** [August 30, 2006, 8:21pm UTC](https://www.ruby-forum.com/t/the-old-switcharoo/66992/1 "2006-08-30T20:21:56Z")

</div>

I have a class that has a lot of data members. On top of that I have a  
lot methods that I dynamically mixin to that class as needed, and they  
of course use those data members. The thing is the methods and data  
members are numerous enough and related in such a way that there is  
some contention for namespace. Since I’m only calling on the methods as  
needed it would be cool if I could acually mix one in, invoke it, and  
then snatch it back out just before executation begins to let the data  
member back in. In other words, I guess I want caller context sensitive  
(cflow?) namespacing.

Interesting? Possible? Any clever ways to pull it off in pure Ruby?

Thanks,  
T.
