diff options
author | stomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-29 20:59:33 +0000 |
---|---|---|
committer | stomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-29 20:59:33 +0000 |
commit | cd63bec1ed547b5234576ea2b91bdb9cb455d3ae (patch) | |
tree | 3f65187399a7931a8934dd76c0bb97d76d57ecec | |
parent | b1e77e85b62a981da439f1c99fe71ab510cb1fdf (diff) | |
download | ruby-cd63bec1ed547b5234576ea2b91bdb9cb455d3ae.tar.gz |
lib/set.rb: improve docs for Set#===
* lib/set.rb: [DOC] improve description and examples for Set#===.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | lib/set.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/set.rb b/lib/set.rb index 5da196d1e0..fb82c105cb 100644 --- a/lib/set.rb +++ b/lib/set.rb @@ -490,20 +490,25 @@ class Set self end - # Returns true if obj is a member of the set, and false otherwise. + # Returns true if the given object is a member of the set, + # and false otherwise. # # Used in case statements: # + # require 'set' + # # case :apple - # when Set[:potato, :carrot] then 'vegetable' - # when Set[:apple, :banana] then 'fruit' + # when Set[:potato, :carrot] + # "vegetable" + # when Set[:apple, :banana] + # "fruit" # end - # #=> "fruit" + # # => "fruit" # # Or by itself: # - # Set[1, 2, 3] === 2 #=> true - # Set[1, 2, 3] === 4 #=> false + # Set[1, 2, 3] === 2 # => true + # Set[1, 2, 3] === 4 # => false # alias === include? |