Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!talisker.lacave.net!lacave.net!not-for-mail From: "Kyle X." Newsgroups: comp.lang.ruby Subject: Re: Simple array.each do |x| question Date: Thu, 31 Mar 2011 17:59:02 -0500 Organization: Service de news de lacave.net Lines: 26 Message-ID: <9d19e7d38f2f3b6ab99b3150717a307c@ruby-forum.com> References: NNTP-Posting-Host: bristol.highgroove.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: talisker.lacave.net 1301612357 23314 65.111.164.187 (31 Mar 2011 22:59:17 GMT) X-Complaints-To: abuse@lacave.net NNTP-Posting-Date: Thu, 31 Mar 2011 22:59:17 +0000 (UTC) In-Reply-To: X-Received-From: This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway X-Mail-Count: 380713 X-Ml-Name: ruby-talk X-Rubymirror: Yes X-Ruby-Talk: <9d19e7d38f2f3b6ab99b3150717a307c@ruby-forum.com> Xref: x330-a1.tempe.blueboxinc.net comp.lang.ruby:2068 Roger Braun wrote in post #990270: > Hi > > 2011/4/1 Kyle X. : >> end > The variable z does not contain an index but the object you need. Try > > direction.each do |z| > n = z.attribute["id"] > result << n > end > > This should also work: > > result = direction.map{|z| z.attribute["id"]} Thanks for the reply; however, both of these produce a new error is being produced: Error: # -- Posted via http://www.ruby-forum.com/.