From: Peter Vandenabeele Date: 2012-02-15T19:52:27+09:00 Subject: [ruby-core:42656] Re: [ruby-trunk - Feature #1400] Please add a method to enumerate fields in OpenStruct --00235429cbe0c97bfc04b8fe81c1 Content-Type: text/plain; charset=UTF-8 On Wed, Feb 15, 2012 at 4:56 AM, Marc-Andre Lafortune < ruby-core@marc-andre.ca> wrote: > > Issue #1400 has been updated by Marc-Andre Lafortune. > > > After reviewing the library, I'm thinking it could be more useful to > implement instead `each_pair` that would yield keys with the corresponding > value (or return an enumerator if no block given). > > *) It matches the equivalent Struct#each_pair > *) It's more powerful > *) It's highly unlikely to generate a conflict > > Thoughts? > Seems good. Is there a specified order for the enumeration? (I presume not, but curious). Peter --00235429cbe0c97bfc04b8fe81c1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Wed, Feb 15, 2012 at 4:56 AM, Marc-Andre Lafo= rtune <ruby= -core@marc-andre.ca> wrote:

Issue #1400 has been updated by Marc-Andre Lafortune.


After reviewing the library, I'm thinking it could be more useful= to implement instead `each_pair` that would yield keys with the correspond= ing value (or return an enumerator if no block given).

*) It matches the equivalent Struct#each_pair
*) It's more powerful
*) It's highly unlikely to generate a conflict

Thoughts?

Seems good.

Is there a specified = order for the enumeration? (I presume not, but curious).

Peter
--00235429cbe0c97bfc04b8fe81c1--