lib/mothership/inputs.rb in mothership-0.3.4 vs lib/mothership/inputs.rb in mothership-0.3.5
- old
+ new
@@ -147,17 +147,20 @@
context.instance_exec(i, *args, &convert)
end
else
context.instance_exec(given, *args, &convert)
end
- elsif meta[:type] == :integer
- given.to_i
- elsif meta[:type] == :float
- given.to_f
- elsif meta[:type] == :boolean
- given == "true"
else
- given
+ case meta[:type]
+ when :integer, :number, :numeric
+ given.to_i
+ when :float
+ given.to_f
+ when :boolean
+ given == "true"
+ else
+ given
+ end
end
end
def default_for(meta, context, *args)
if meta.key?(:default)