[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Enumerator for Hash

Ryan Hinton

5/23/2007 3:00:00 AM

I have a complex object that I want to hash in different ways, similar
to the way Enumerator allows for iterating using something besides
#each. For one Hash I can use the #hash method for indexing, but for
another hash I want to use some other method. I cannot find an easy
way to do this.

Any suggestions?

1 Answer

Robert Klemme

5/23/2007 7:42:00 AM

0

On 23.05.2007 04:59, Ryan Hinton wrote:
> I have a complex object that I want to hash in different ways,

You write "hash" which usually means "calculate hash value for" but the
following text seems to indicate that you want to iterate.

> similar
> to the way Enumerator allows for iterating using something besides
> #each. For one Hash I can use the #hash method for indexing,

Now you mention "indexing" and #hash method in one sentence.

> but for
> another hash I want to use some other method. I cannot find an easy
> way to do this.

Frankly, I am at a loss here. What do you want? (I have some possible
questions in mind but I'd rather hear it from you.)

> Any suggestions?

Make clear what you actually want. You could also show some code.

Kind regards

robert