From: Pit Capitain Date: 2006-10-17T04:39:00+09:00 Subject: Re: include inside and outside classes John Ky schrieb: > Why is it that when I can do this: > >> include Math >> puts sqrt(169) > > I can't do this?: > >> class X >> include Math >> puts sqrt(169) >> end Rick has already written about the differences between class scope and toplevel scope. (Are you reading this, Tom?) With #include you can call the Math methods in instance methods: class X include Math def m puts sqrt(169) end end X.new.m # => 13.0 If you want to call the methods in class scope, you have to use #extend: class X extend Math puts sqrt(169) # => 13.0 end Regards, Pit