minad/unit — pull request #14 by ryanong (2012-01-14 20:13:15+00:00)
Title: Re-factor to only use numeric with arithmetic and other changes

When I create apis I create them with the [Principle of least astonishment](http://en.wikipedia.org/wiki/Principle_of_least_astonishment).
With the way it is coded now, you can add an array, a string, or a symbol to a unit. This is surprising ability. A unit class is a type of numeric. And every other Numeric will fail miserably when you try to add an array, string, or symbol to it.

Look at what allowing adding and subtracting strings and integers have done in javascript. IT IS A HORRIBLE MESS.

As for coerce, it is just a wrapper around Unit.to_unit why not just use to_unit and skip the extra variable assignment.

largest to smallest changes:

1. Changed arithmetic operations to support only Numeric, reason above.
2. removed usage of #coerce internally, it just delegates to #to_unit
3. changed eql? and == to follow ruby conventions http://www.skorks.com/2009/09/ruby-equality-and-object-comparison/
4. Replace NoUnitSupport with IncompatibleUnitError
5. Replace alias with alias_method http://blog.bigbinary.com/2012/01/08/alias-vs-alias-method.html