Judson Lester
1/25/2008 11:34:00 PM
On Jan 25, 2008 3:00 PM, Jeff Turcotte <jeff.turcotte@gmail.com> wrote:
> I'm trying to create a new globally available subclass upon the
> inheritance of another class. This code isn't close to complete, but I
> think I'm on the right track.
>
> class PersonHelper; end
>
> class Person
> def self.inherited(klass)
> helper = Object.const_get(klass.to_s + 'Helper')
Instead try:
const_set(klass.to_s + 'Helper', class.new(PersonHelper))
> # define class here?
yes :)
klass.class_eval do
...
end
--
Your subnet is currently 169.254.0.0/16. You are likely to be eaten by a grue.