From: David Alan Black Date: 2002-06-22T04:23:24+09:00 Subject: Re: Mixin using append_features and class< Hello to all, > > First, I'm new to ruby so please forgive if I read over the solution in > the ruby doc or pickaxe book. Welcome nuby! > I'd like to know if it's possible to add a method to an object > _instance_ at runtime? I tried sth. like instance_eval and "class << > self" which works. But do I add a mixin at runtime? > > I have a Mixin like this: > > Module B > def B.append_features(aClass) > def aClass.foo > "foo" > end > end > end > > o = Object.new > o.instance_eval<<-"end_eval" > include B > end_eval > > But o.foo does not exist!? > > Is there a way to use append_features together with class<