From: Aaron Patterson Date: 2008-03-13T04:53:15+09:00 Subject: Re: Get OpenStruct attributes On Thu, Mar 13, 2008 at 04:04:57AM +0900, Ed Hames wrote: > Dear rubyists, > > What's the best way to get the list of attributes of an OpenStruct? Not perfect, but this might do the trick: >> require 'ostruct' => true >> x = OpenStruct.new(:foo => 'asdf') => # >> x.methods - OpenStruct.instance_methods => ["foo", "foo="] >> -- Aaron Patterson http://tenderlovemaking.com/