From: Tool69 Date: 2005-12-10T08:02:58+09:00 Subject: Re: different methods for initializing one object? Thanks for all your answers, in fact, my class was already written with the last mentioned code method. class Point attr_accessor :abs, :ord, :name, :cart def initialize(abs,ord,name="") @abs = abs @ord = ord @name = name @cart = true end def to_s "#@name : (#{@abs}, #{@ord})" end def ==(unPoint) unPoint.abs = abs and unPoint.ord = ord end def Point.new_polaire(rho, theta, name) @cart = false @name = name unPoint = new(rho*cos(theta),rho*sin(theta),@name) return unPoint end end ....but I dislike the calling syntax. I thought it was possible to write several constructors calls like in Java, ie : void Move(Vector2D vector) { center.x += vector.x; center.y += vector.y; } void Move(double x,double y) { center.x += x; center.y += y; } So, my idea was bad : Ruby is not Java !