lib/percentable/percent.rb in percentable-1.0.1 vs lib/percentable/percent.rb in percentable-1.0.2
- old
+ new
@@ -48,11 +48,11 @@
[:+, :-, :/].each do |operator|
define_method operator do |other|
case other
when Percent
self.class.new(value.public_send(operator, other.value))
- when Numeric
- self.class.new(value.public_send(operator, other))
+ else
+ self.class.new(value.public_send(operator, other.to_f))
end
end
end
def to_percent