<html><head><meta name="Generator" content="PSI HTML/CSS Generator"/>
<style type="text/css"><!--
body{font-family:'Tahoma';font-size:10pt;font-color:'#000000';}
LI{display:list-item;margin:0.00in;}
p{display:block;margin:0.00in;}
body{}
--></style>
</head><BODY ><div><SPAN style="font-size:10pt;">Guess I should have googledarder/longer I have found some code that appears to work. Now I'll have topend sometime stepping through it.</SPAN></div>
<div><SPAN style="font-size:10pt;">Here is the code:</SPAN></div>
<div>&nbsp;</div>
<div style="margin-top:0.07in;"><SPAN style="font-family:'Times Newoman';font-size:12pt;">class Array<br />def to_h(&amp;block)<br>Hash[*self.collect { |v|<br />[v, block.call(v)]<br />}.flatten]<br>end<br />end</SPAN></div>
<div><SPAN style="font-size:10pt;">&#160;</SPAN></div>
<div>&nbsp;</div>
<div><SPAN style="font-size:10pt;">and the link to the page:</SPAN></div>
<div><SPAN style="font-size:10pt;"><aref="http://snippets.dzone.com/posts/show/302">http://snippets.dzone.com/posts/show/302</a></SPAN></div>
<div>&nbsp;</div>
<div><SPAN style="font-size:10pt;">Harold, Please forgive mympatience</SPAN></div>
<div>&nbsp;</div>
<div><SPAN style="font-size:10pt;">Sam<br /><br /></span></div>
<div><SPAN style="font-size:10pt;color:navy;">&gt; Hello all</SPAN></div>
<div><SPAN style="font-size:10pt;color:navy;">&gt; &#160;  Is there a methodo collect the items in an array into a hash</SPAN></div>
<div><SPAN style="font-size:10pt;color:navy;">&gt;</SPAN></div>
<div><SPAN style="font-size:10pt;color:navy;">&gt; I want to go from this X3D[1,2,3,4,5,6] to this Y={1 =&gt;2, 3 =&gt;4, 5</SPAN></div>
<div><SPAN style="font-size:10pt;color:navy;">&gt; =&gt;6}</SPAN></div>
<div><SPAN style="font-size:10pt;color:navy;">&gt;</SPAN></div>
<div><SPAN style="font-size:10pt;color:navy;">&gt; Just seems like therehould be one</SPAN></div>
<div><SPAN style="font-size:10pt;color:navy;">&gt;</SPAN></div>
<div><SPAN style="font-size:10pt;color:navy;">&gt; Thanks indvance</SPAN></div>
<div><SPAN style="font-size:10pt;color:navy;">&gt;</SPAN></div>
<div><SPAN style="font-size:10pt;color:navy;">&gt; Sam</SPAN></div>
</body></html>