lib/rice_bubble/attributes/number.rb in rice_bubble-0.1.2 vs lib/rice_bubble/attributes/number.rb in rice_bubble-0.2.0
- old
+ new
@@ -7,11 +7,15 @@
super(&)
@min = min
@max = max
end
+ def valid_types
+ [::Numeric]
+ end
+
def valid?(value)
- value.is_a?(::Numeric) &&
+ super &&
!min&.send(:>, value) &&
!max&.send(:<, value)
end
def description