diff options
Diffstat (limited to 'lib/slop/types.rb')
-rw-r--r-- | lib/slop/types.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/slop/types.rb b/lib/slop/types.rb index c53319c..4ccd42e 100644 --- a/lib/slop/types.rb +++ b/lib/slop/types.rb @@ -6,6 +6,13 @@ module Slop end end + # Cast the option argument to a symbol. + class SymbolOption < Option + def call(value) + value.to_sym + end + end + # Cast the option argument to true or false. # Override default_value to default to false instead of nil. # This option type does not expect an argument. However, the API |