Answer the question
In order to leave comments, you need to log in
Why does c each work like this in ruby?
found_small = found_page.search('small').each_with_index do | id, i |
@uuid = [ i => id ]
end
puts @uuid
Answer the question
In order to leave comments, you need to log in
hash = Hash.new
%w(cat dog wombat).each_with_index {|item, index|
hash[item] = index
}
hash #=> {"cat"=>0, "dog"=>1, "wombat"=>2}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question