Re: Simple array.each do |x| question



Roger Braun wrote in post #990270:
Hi

2011/4/1 Kyle X. <haebooty@xxxxxxxxx>:
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: #<ArgumentError: C:/Program Files (x86)/Google/Google SketchUp
8/Plugins/examples/one.rb:62:in `attribute': wrong number of arguments
(0 for 1)>

--
Posted via http://www.ruby-forum.com/.

.