From: "F. Senault" Date: 2009-01-17T20:08:51+09:00 Subject: Re: Defining an object constructor that look like [] or {} ...? Le 16 janvier 2009 � 20:26, Tom Link a �crit : >> my_object = MyClass.new([2, 3, 5, 7]) > > You should be able to use > > [] as class method: > > my_object = MyClass[2, 3, 5, 7] > > a method in Kernel or similar: > > my_object = MyClass(2, 3, 5, 7) A method in Array : class Array def to_my_class MyClass.new(self) end end my_object = [2, 3, 5, 7].to_my_class Fred -- You believe this heat Another empty house, another dead end street Gonna rest my bones and sit for a spell This side of heaven, this close to hell (Guns n' Roses, Right Next Door to Hell)