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
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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.