Thanks, guys! coercing mechanism is really useful. Due to multiplication 
is commutative, I just swapped multiplier in coerce method, so even if 
(2 * vector) is called, it calls vector.+(2) finally.

def *(scalar)
  Vector.new(x * scalar, y * scalar)
end

def coerce(scalar)
  [self, scalar]
end

vector * 2  # vector.*(2) is called
2 * vector  # 2.*(vector), then vector.coerce(2), then vector.*(2)

Thanks again! :)
-- 
Posted via http://www.ruby-forum.com/.