From: Terry Smith Date: 2009-08-24T13:02:45+09:00 Subject: Re: Stupid OpenStruct question got it ff = s.fields ff.each{|g| puts s.instance_eval g } 1 2 Terry Smith wrote: > Ok - I know how to get the fields of an Openstruct object like so > > class OpenStruct > def fields > @table.keys.map{|k| k.to_s} > end > end > > a = OpenStruc.new() > a.foo = 1 > a.bar = 2 > > a.fields -> ["foo", "bar"] > > Great - ok how do I WORK with these once I have them? > > call doesn't work [] doesn't work... > > I KNOW this is one of those obvious ones that I am somehow > overlooking... > > Please tell me the simple straightforward thing I am missing here... -- Posted via http://www.ruby-forum.com/.