From: yvon.thoravalNO-SPAM@... (Yvon Thoraval) Date: 2004-03-27T16:44:25+09:00 Subject: [newbie] linked hash i'm transalating a BeanShell prog using : Map fieldsHash = new LinkedHashMap(); fieldsHash.put("btl_desc", "Description"); fieldsHash.put("btl_vintage", "Millesime"); fieldsHash.put("btl_buy_date", "Date achat"); fieldsHash.put("wcol_id", "Coul."); fieldsHash.put("btl_init_nbr", "Qte A"); fieldsHash.put("btl_current_nbr", "Qte R"); i've seen the PseudoHash of Gotoken : class PseudoHash < Hash VERSION = "2000-12-25" def order @order ||= [] end def order=(ary) order.replace ary end def with_order(ary) self.order = ary self end def order_of(key) order.index(key) end alias __each__ each alias aset []= def []=(k, *rest) val, set = rest.reverse order.push k if set and not order.include? k aset(k,val) end def each rest = keys - order order.each {|k| yield(k, self[k]) if include?(k)} rest.each {|k| yield(k, self[k]) } end alias each_pair each end i want to emulate that LinkedHashMap into ruby without calling the java class (it's possible because i'm using JRuby) how could i make modifications, if any, Gotoken's code for that ? -- yt