Afficher un message
Vieux 12/03/2008, 22h01   #5
Martin DeMello
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Get OpenStruct attributes

On Wed, Mar 12, 2008 at 12:54 PM, Jason Roelofs <jameskilton@gmail.com> wrote:

> The "dirty" way:
>
> >> o.instance_variable_get("@table")

> => {:field=>"this", :fold=>"that"}


That's actually the cleanest way - it's proof against singleton
methods being added to the object.

martin

  Réponse avec citation
 
Page generated in 0,04039 seconds with 9 queries