From: Jason Merrill Date: 2006-10-28T02:44:29+09:00 Subject: Re: classless methods And since Object is an ancestor of pretty much everything in ruby, it's interesting to note that these methods are now defined for practically everything in ruby: irb(main):001:0> def say_hello irb(main):002:1> "Hello" irb(main):003:1> end => nil irb(main):004:0> say_hello => "Hello" irb(main):005:0> [1,3,5].say_hello => "Hello" irb(main):006:0> Array.say_hello => "Hello" irb(main):007:0> Hash.say_hello => "Hello" irb(main):008:0> On 10/27/06, matt neuburg wrote: > Dave Rose wrote: > > > what class does a classless independent method belong too? > > another words if i just make an new irb session and type: > > > > def widget(tidbit) > > tidbit > > end > > > > a=1.0 > > puts widget(a) > > > > b='string' > > > > puts widget(b) > > > > what class will the widget method belong too? > > > > m. > > > -- > matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt/ > Tiger - http://www.takecontrolbooks.com/tiger-customizing.html > AppleScript - http://www.amazon.com/gp/product/0596102119 > Read TidBITS! It's free and smart. http://www.tidbits.com > >