lib/permit_params.rb in sinatra-my-params-0.0.5 vs lib/permit_params.rb in sinatra-my-params-0.0.6
- old
+ new
@@ -18,11 +18,14 @@
end
private
Boolean = :boolean
+ Any = :any
def coerce(param, type, strong_validation = false, options = {})
+ return param if type == Any
+
begin
return nil if param.nil?
return param if (param.is_a?(type) rescue false)
return Integer(param, 10) if type == Integer
return Float(param) if type == Float