From: MonkeeSage Date: 2006-09-15T20:00:51+09:00 Subject: Re: Merging two anonymous structs Zouplaz wrote: > Hello, I wonder if it's possible to merge two #struct objects ? It's possible, but it's probably better to use Hashes instead. You can always convert a Hash to a Struct [1] after you're done fiddling with it. But if you really want to merge two structs, you could do something like this: def struct_join(main, other) mems = main.members + other.members vals = main.values + other.values Struct.new(nil, *mems).new(*vals) end [1] http://rubyforge.org/snippet/detail.php?type=snippet&id=1 Regards, Jordan