# Inserting Classes into a Module Dynamically?

**URL:** <https://www.ruby-forum.com/t/inserting-classes-into-a-module-dynamically/182837>\
**Category:** Ruby\
**Created:** [February 3, 2010, 5:40pm UTC](https://www.ruby-forum.com/t/inserting-classes-into-a-module-dynamically/182837 "2010-02-03T17:40:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thunk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e495f1/32.png) [@thunk](https://www.ruby-forum.com/u/thunk)\
**Post date:** [February 3, 2010, 5:40pm UTC](https://www.ruby-forum.com/t/inserting-classes-into-a-module-dynamically/182837/1 "2010-02-03T17:40:24Z")

</div>

Hi guys,

We are now able to author code on-line, which allows us to create a  
new class. We want to “insert” this new class into a module and make  
it “instantly” available to the using program(s) - without restarting  
them.

I think I remember reading that this is possible somehow, but I  
haven’t much of clue where to look on this one.

Thanks for any assistance on this!

Thunk

---

<div class="post-metadata">

**Author:** ![thunk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e495f1/32.png) [@thunk](https://www.ruby-forum.com/u/thunk)\
**Post date:** [February 3, 2010, 5:41pm UTC](https://www.ruby-forum.com/t/inserting-classes-into-a-module-dynamically/182837/2 "2010-02-03T17:41:48Z")

</div>

thunk wrote:

> Hi guys,
> 
> We are now able to author code on-line, which allows us to create a  
> new class. We want to “insert” this new class into a module and make  
> it “instantly” available to the using program(s) - without restarting  
> them.
> 
> I think I remember reading that this is possible somehow, but I  
> haven’t much of clue where to look on this one.

Look at the instance methods of Module, particularly include and extend.

> Thanks for any assistance on this!
> 
> Thunk

Best,  
–Â  
Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
