ruby-units
ruby-units copied to clipboard
Use module prepend
RubyUnits defines some custom behavior for other classes, which either permit easy conversion into Unit objects or which define custom numeric behavior to allow Numeric objects and Unit objects to interoperate properly. These were previously defined using method aliasing, but there are better ways, like using Module#prepend.
Note: the behavior of Numeric#to_unit changed here to be more consistent with how this method behaves in other classes. This is a breaking change.