From: Dot Baiki Date: 2008-09-16T01:40:07+09:00 Subject: Re: Need someone who can help Doug Glidden wrote: > On the other hand, if all you're interested in is calculating the area > and you don't actually need to store the information, use a mixin > instead of a full-blown class: > > Module AreaOfCircle > PI = 3.14159265 > > def calc_area(radius) > PI * radius**2 > end > end > > # begin program code > > include AreaOfCircle > > print 'Enter radius of circle: ' > radius = gets.to_f > puts "You entered: #{radius}" > > screen_output = calc_area radius > puts "Result: #{screen_output}" > > I know I threw a lot of stuff at you, so feel free to ask about anything > you don't understand there. > > Doug Hi Doug, Uffff :-) Need more time to analyze your code. Need also to read next chapter in my book first. Take a little time. I'm not genius. But, great input. Baiki -- Posted via http://www.ruby-forum.com/.