[前][次][番号順一覧][スレッド一覧]

ruby-changes:48459

From: stomar <ko1@a...>
Date: Mon, 30 Oct 2017 05:59:38 +0900 (JST)
Subject: [ruby-changes:48459] stomar:r60573 (trunk): lib/set.rb: improve docs for Set#===

stomar	2017-10-30 05:59:33 +0900 (Mon, 30 Oct 2017)

  New Revision: 60573

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60573

  Log:
    lib/set.rb: improve docs for Set#===
    
    * lib/set.rb: [DOC] improve description and examples for Set#===.

  Modified files:
    trunk/lib/set.rb
Index: lib/set.rb
===================================================================
--- lib/set.rb	(revision 60572)
+++ lib/set.rb	(revision 60573)
@@ -490,20 +490,25 @@ class Set https://github.com/ruby/ruby/blob/trunk/lib/set.rb#L490
     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?
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]