# Evil Fun with IronRuby

**URL:** <https://www.ruby-forum.com/t/evil-fun-with-ironruby/140791>\
**Category:** IronRuby\
**Created:** [June 18, 2008, 4:14pm UTC](https://www.ruby-forum.com/t/evil-fun-with-ironruby/140791 "2008-06-18T16:14:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f4b2a3/32.png) [@Joe\_F](https://www.ruby-forum.com/u/Joe_F)\
**Post date:** [June 18, 2008, 4:14pm UTC](https://www.ruby-forum.com/t/evil-fun-with-ironruby/140791/1 "2008-06-18T16:14:34Z")

</div>

Hey all,  
I posted the results of some recent experimenting with IronRuby to my  
blog  
at: [http://faithfulgeek.org/2008/6/17/evil-fun-with-ironruby](http://faithfulgeek.org/2008/6/17/evil-fun-with-ironruby). My  
question  
is, how do these things work under the covers? Do .NET types that have  
a  
Ruby equivalent get treated as the Ruby type or is there an extra layer  
that  
allows any .NET type to be modified at runtime? It’s totally cool that  
any  
of this is possible, but I was very surprised that it is.

Thanks all!

---

<div class="post-metadata">

**Author:** ![Joe\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f4b2a3/32.png) [@Joe\_F](https://www.ruby-forum.com/u/Joe_F)\
**Post date:** [June 18, 2008, 4:40pm UTC](https://www.ruby-forum.com/t/evil-fun-with-ironruby/140791/2 "2008-06-18T16:40:04Z")

</div>

I left a comment on your blog, but I’ll answer here as well.

IronRuby adds the Ruby Enumerable mixin to IEnumerable objects, which  
allows  
for CLR lists and collections to act more like Ruby arrays. And the new  
methods you add to CLR classes in IronRuby will not be available when  
calling them from a non-DLR language like C#.

---

<div class="post-metadata">

**Author:** ![Joe\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f4b2a3/32.png) [@Joe\_F](https://www.ruby-forum.com/u/Joe_F)\
**Post date:** [June 18, 2008, 6:09pm UTC](https://www.ruby-forum.com/t/evil-fun-with-ironruby/140791/3 "2008-06-18T18:09:41Z")

</div>

We wouldn’t be very true to Ruby if we didn’t allow you to “monkey  
patch” CLR classes and interfaces. And really, this isn’t all that  
different than using extension methods in C#.

All classes in IronRuby have a “RubyClass” object associated with them,  
even if the class is being imported from the CLR. It’s this object that  
defines and manages the Ruby aspects of the class implementation.

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Joe F.  
Sent: Wednesday, June 18, 2008 7:14 AM  
To: removed\_email\_address@domain.invalid  
Subject: [Ironruby-core] Evil Fun with IronRuby

Hey all,

I posted the results of some recent experimenting with IronRuby to my  
blog at: [http://faithfulgeek.org/2008/6/17/evil-fun-with-ironruby](http://faithfulgeek.org/2008/6/17/evil-fun-with-ironruby). My  
question is, how do these things work under the covers? Do .NET types  
that have a Ruby equivalent get treated as the Ruby type or is there an  
extra layer that allows any .NET type to be modified at runtime? It’s  
totally cool that any of this is possible, but I was very surprised that  
it is.

Thanks all!
