diff options
author | Lee Jarvis <lee@jarvis.co> | 2011-03-16 18:50:30 +0000 |
---|---|---|
committer | Lee Jarvis <lee@jarvis.co> | 2011-03-16 18:50:30 +0000 |
commit | 08860d8547e47ac85381099b87cba888c5019e78 (patch) | |
tree | ffc21bbba3cf5bb6783c51cc7957a3ea3ae963bb | |
parent | a6ff75ab95fcd9f7bcc2d5806f100d75f77975e9 (diff) | |
download | slop-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.rb | 4 |
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 |