module Matrix::CoercionHelper

def apply_through_coercion(obj, oper)


through coercion of +obj+
Applies the operator +oper+ with argument +obj+

:nodoc:
def apply_through_coercion(obj, oper)
  coercion = obj.coerce(self)
  raise TypeError unless coercion.is_a?(Array) && coercion.length == 2
  coercion[0].public_send(oper, coercion[1])
rescue
  raise TypeError, "#{obj.inspect} can't be coerced into #{self.class}"
end