diff options
author | Lee Jarvis <ljjarvis@gmail.com> | 2013-01-13 18:45:20 +0000 |
---|---|---|
committer | Lee Jarvis <ljjarvis@gmail.com> | 2013-01-13 18:45:20 +0000 |
commit | edddf1a35ccea52dc559ddd40590cb5b66dd8d5c (patch) | |
tree | 37f76945877baf12b836d44eaab10867c679a5bb /lib/slop/option.rb | |
parent | 6e4d2b6ca6c5a20e8265c857422f7e7febd33e97 (diff) | |
download | slop-edddf1a35ccea52dc559ddd40590cb5b66dd8d5c.tar.gz |
ensure Object#eql? checks against short and long flags
Diffstat (limited to 'lib/slop/option.rb')
-rw-r--r-- | lib/slop/option.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/slop/option.rb b/lib/slop/option.rb index c63fd1a..0e92e76 100644 --- a/lib/slop/option.rb +++ b/lib/slop/option.rb @@ -122,6 +122,14 @@ class Slop end end + def eql?(other) + short and short == other.short or long and long == other.long + end + + def hash + [short, long].hash + end + # Returns the help String for this option. def to_s return config[:help] if config[:help].respond_to?(:to_str) |