On Mon, Feb 13, 2012 at 4:08 PM, Yusuke Endoh <mame / tsg.ne.jp> wrote:

>
> Issue #1400 has been updated by Yusuke Endoh.
>
> Assignee changed from Yukihiro Matsumoto to Marc-Andre Lafortune
>
> Hello,
>
> There is no maintainer for ostruct.
> Marc-Andre, are you willing to be a maintainer and to commit
> your patch?  I give +1 for __members__.
>
> I consider Dan's comment is not objection.  What Tomas wants is
> a way to get field names without depending on the openstruct
> internal.  But the ways that Dan proposed are deeply depending
> on it.  For other topics, please register bug ticket for each.
>

I use OpenStruct#marshal_dump for this purpose,
which is a public method and returns a clean hash.

$ irb
1.9.3p0 :001 > require 'ostruct'
 => false
1.9.3p0 :002 > car = OpenStruct.new
 => #<OpenStruct>
1.9.3p0 :003 > car.wheels = 4
 => 4
1.9.3p0 :004 > car.seats = 5
 => 5
1.9.3p0 :005 > car.marshal_dump
 => {:wheels=>4, :seats=>5}

Sincerely,

Peter


-- 
*** Available for a new project ***

Peter Vandenabeele
http://twitter.com/peter_v
http://rails.vandenabeele.com
http://coderwall.com/peter_v