From: "F. Senault" Date: 2010-09-02T19:20:11+09:00 Subject: Re: hash problem Le 01 septembre � 17:43, Peter Hickman a �crit : > data = Array.new > data << {"name" => "Admiral Ackbar"} > data << {"name" => "Bail Organa"} C'mon, where's the fun in that ? :) >> require "ostruct" => true >> a = [] => [] >> a << OpenStruct.new(:name => "Admiral Ackbar", :age => 30) => [#] >> a << OpenStruct.new(:name => "Bail Organa", :age => 65) => [#, #] >> a[0].name => "Admiral Ackbar" >> a[1].age => 65 >> a.find { |e| e.age > 50 } => # Fred -- The key to my survival Was never in much doubt The question was how I could keep sane Trying to find the way out Things were never easy for me Peace of mind was hard to find And I needed a place where I could hide Somewhere I could call mine (Genesis, No Son of Mine)