# RubySites

**URL:** <https://www.ruby-forum.com/t/rubysites/120046>\
**Category:** IronRuby\
**Created:** [November 13, 2007, 11:24am UTC](https://www.ruby-forum.com/t/rubysites/120046 "2007-11-13T11:24:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![editkid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/977dab/32.png) [@editkid](https://www.ruby-forum.com/u/editkid)\
**Post date:** [November 13, 2007, 11:24am UTC](https://www.ruby-forum.com/t/rubysites/120046/1 "2007-11-13T11:24:04Z")

</div>

Is there any rule for when you should put DynamicSite instances into  
Ruby.Builtins.RubySites rather than local to the class that uses them?

As an example, Numeric has a method called coerce that is used quite a  
lot  
inside Numeric but occasionally used in other classes. Should the  
DynamicSite for this be inside Ruby.Builtins.Numeric or  
Ruby.Builtins.Sites?

Pete

No virus found in this outgoing message.  
Checked by AVG Free Edition.  
Version: 7.5.503 / Virus Database: 269.15.30/1127 - Release Date:  
12/11/2007  
21:19

---

<div class="post-metadata">

**Author:** ![editkid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/977dab/32.png) [@editkid](https://www.ruby-forum.com/u/editkid)\
**Post date:** [November 13, 2007, 8:52pm UTC](https://www.ruby-forum.com/t/rubysites/120046/2 "2007-11-13T20:52:28Z")

</div>

Peter Bacon D.:

> Is there any rule for when you should put DynamicSite instances into  
> Ruby.Builtins.RubySites rather than local to the class that uses them?
> 
> As an example, Numeric has a method called coerce that is used quite a  
> lot inside Numeric but occasionally used in other classes. Should the  
> DynamicSite for this be inside Ruby.Builtins.Numeric or  
> Ruby.Builtins.Sites?

We don’t have any hard and fast rules about this. The general rule is if  
you believe that the site is useful across more than a single type, then  
it’s OK to move into Builtins.Sites since your locality of reference is  
already pooched.

-John
