From: Nathan Powell Date: 2008-09-15T22:16:47+09:00 Subject: Re: Need someone who can help Are you looking at the error? It clearly tells you what the problem is. "wrong number of arguments". Your initialize method takes two parameters, and you aren't passing in any. On Mon, Sep 15, 2008 at 10:11:28PM +0900, Dot Baiki wrote: > Hello > > Please, can someone help me with this problem. I am really stuck. Can't > find my problem. Simple code snippet is not working at all. I totally > desperate. > > Look at this: > --------------------start > #!/usr/bin/env ruby > > class AreaOfCircle > > PI = 3.14159265 > > def initialize(radius, area) > @radius = radius > @area = area > end > > def calc_area(radius) > @area = PI * @radius**2 > end > end > > print 'Enter radius of circle: ' > keyboard_input = gets > radius = keyboard_input.to_f > > instance = AreaOfCircle.new > screen_output = instance.calc_area(keyboard_input) > puts screen_output > ----------------------------------- end > > I'm already pulling my hairs (not much left by now). Hopefully you can > give me any hint! > > Regards, > Baiki > -- > Posted via http://www.ruby-forum.com/. > -- nathan nathan_at_nathanpowell_dot_org What kind of crazy nut would spend two or three hours a day just running? ~ Steve Prefontaine ------------------------------------