APIdock / Ruby
/
method

each2

ruby latest stable - Class: Vector
each2(v)
public

Iterate over the elements of this vector and v in conjunction.

# File lib/matrix.rb, line 1788
 def each2(v) # :yield: e1, e2
 raise TypeError, "Integer is not like Vector" if v.kind_of?(Integer)
 Vector.Raise ErrDimensionMismatch if size != v.size
 return to_enum(:each2, v) unless block_given?
 size.times do |i|
 yield @elements[i], v[i]
 end
 self
 end

AltStyle によって変換されたページ (->オリジナル) /