lib/fractional.rb in fractional-1.2.0 vs lib/fractional.rb in fractional-1.2.1

- old
+ new

@@ -11,17 +11,15 @@ case value when Rational @value = value when String @value = Fractional.string_to_fraction( value, options ) - when Fixnum + when Numeric if @value == @value.to_i @value = Rational(value) else # It's still Rational if it's a natural number @value = Fractional.float_to_fraction( value.to_f, options ) end - when Numeric - @value = Fractional.float_to_fraction( value.to_f, options ) else raise TypeError, "Cannot instantiate Fractional from #{value.class}" end end