From: Thomas Wieczorek Date: 2008-01-22T23:28:01+09:00 Subject: Re: Hash two dimensions On Jan 22, 2008 2:39 PM, jandot wrote: > > class Setting > def initialize(platform, setting, value) > @platform, @setting, @value = platform, setting, value > end > attr_accessor :platform, :setting, :value > end > > configuration = Array.new > configuration.push(Setting.new("UNO", "urlX", "beep/UNO/playdoit.do")) > configuration.push(Setting.new("UNO", "urlY", "beep/UNO/ > dontplayPP.do")) > You can do the same with Ruby's built-in Structs with less code: Setting = Struct.new(:platform, :setting, :value) configuration = Array.new configuration.push(Setting.new("UNO", "urlX", "beep/UNO/playdoit.do")) configuration.push(Setting.new("UNO", "urlY", "beep/UNO/dontplayPP.do")) last = configuration.pop puts last.platform I also like that one http://groups.google.de/group/comp.lang.ruby/msg/d11d68c9d3889cc5