- Code: Select all
class Numeric # open class for editing:
alias_method(:deg2rad,:degrees) unless method_defined?(:deg2rad)
alias_method(:rad2deg,:radians) unless method_defined?(:rad2deg)
end # class Numeric
They like using the "2" to mean "to"... but would the REAL Ruby way be more like:
deg_to_rad and rad_to_deg ??
