--0015174be26a1adf3004b0265d3e
Content-Type: text/plain; charset=ISO-8859-1

The error indicates that you are calling "each" method on a Fixnum object.
You can just do a simple verification inside the each loop like this:

array.each do |x|
  do something unless x.class "Array"
  do something else with inner arrays
end

2011/10/25 juman s. <jsalih75 / yahoo.ie>

>
> a"doc1",["hi","bye","guy"],[],[],[]],["doc2",["bye","now","is","hi","hi","hi"],[],[],[]],["doc3",["bye","now","is","hi","hi","hi","why","go","guy"],[],[],[]]]
>
> i have this array i'd like to multiply the 2nd inner array with the 3rd
> inner array and fill the 4th inner array with these results but i don't
> know how to do it. by the way the 2nd and the third inner array are of
> type float.
> anybody ca help please?
> and thanks in advance:)
>
> a.each{
>   |x|
>    x.each{
>     |y|
>        y.each{  #i have the error in here
>
>        }
>
>
>  }
> }
>
> and the error is
> tester.rb:50: undefined method `each' for 1:Fixnum (NoMethodError)
>  from tester.rb:48:in `each'
>  from tester.rb:48
>  from tester.rb:46:in `each'
>  from tester.rb:46
>
> --
> Posted via http://www.ruby-forum.com/.
>
>


-- 
Life is a miracle.

--0015174be26a1adf3004b0265d3e--