summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Jarvis <lee@jarvis.co>2011-03-16 18:50:30 +0000
committerLee Jarvis <lee@jarvis.co>2011-03-16 18:50:30 +0000
commit08860d8547e47ac85381099b87cba888c5019e78 (patch)
treeffc21bbba3cf5bb6783c51cc7957a3ea3ae963bb
parenta6ff75ab95fcd9f7bcc2d5806f100d75f77975e9 (diff)
downloadslop-08860d8547e47ac85381099b87cba888c5019e78.tar.gz
call to_s before to_i/f in case a default is passed in which wont respond
-rw-r--r--lib/slop/option.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/slop/option.rb b/lib/slop/option.rb
index e49de18..c8e3618 100644
--- a/lib/slop/option.rb
+++ b/lib/slop/option.rb
@@ -70,8 +70,8 @@ class Slop
value.split(@options[:delimiter] || ',', @options[:limit] || 0)
when 'String'; value.to_s
when 'Symbol'; value.to_s.to_sym
- when 'Integer'; value.to_i
- when 'Float'; value.to_f
+ when 'Integer'; value.to_s.to_i
+ when 'Float'; value.to_s.to_f
else
value
end