From: Gunther Diemant Date: 2011-04-01T08:06:07+09:00 Subject: Re: Simple array.each do |x| question --00504502d319791600049fcf565e Content-Type: text/plain; charset=ISO-8859-1 attribute is a method, so try z.attribut('id') 2011/4/1 Kyle X. > 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: # 8/Plugins/examples/one.rb:62:in `attribute': wrong number of arguments > (0 for 1)> > > -- > Posted via http://www.ruby-forum.com/. > > --00504502d319791600049fcf565e--