
class Numeric

  # Provides a boolean interpretation of self.
  # If self == 0 then false else true.
  #
  #   0.to_b    #=> false
  #   1.to_b    #=> true
  #   2.3.to_b  #=> true
  #
  def to_b
    self == 0 ? false : true
  end

end



#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
=begin test

  require 'test/unit'

  class TCNumeric < Test::Unit::TestCase

    def test_to_b
      assert_equal( false, 0.to_b )
      assert_equal( true, 1.to_b )
    end

  end

=end
