Re: Form responders

Michael Houghton
2005-10-05T16:46:39Z

Oh, that''s cool :) Thanks for the tip.

On 5 Oct 2005, at 07:45, Duane Johnson wrote:

> If I understand the problem correctly, you can use an
''ostruct'' to
> accomplish what you''re looking for.
>
> irb(main):001:0> require ''ostruct''
> => true
> irb(main):002:0> user = OpenStruct.new(:first_name =>
"Duane",
> :last_name => "Johnson")
> => <OpenStruct first_name="Duane"
last_name="Johnson">
> irb(main):003:0> user.first_name
> => "Duane"
>
> You can set, for example, a @user instance variable and let it act
> like the handy little accessor object that it is.