aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--enum.c5
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 920a8016b2..4ddf96b5c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri May 6 08:16:26 2016 David Silva <david.silva@digital.cabinet-office.gov.uk>
+
+ * enum.c (enum_find): [DOC] add more examples to the documentation
+ of Enumerable#detect, to show that it equals to Enumerable#find.
+ [Fix GH-1340]
+
Thu May 5 18:08:31 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
* test/ruby/test_complexrational.rb: Remove duplicated raise.
diff --git a/enum.c b/enum.c
index 9387ec3b6a..7ecf00e56b 100644
--- a/enum.c
+++ b/enum.c
@@ -225,7 +225,12 @@ find_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
*
* If no block is given, an enumerator is returned instead.
*
+ * (1..100).detect => #<Enumerator: 1..100:detect>
+ * (1..100).find => #<Enumerator: 1..100:find>
+ *
* (1..10).detect { |i| i % 5 == 0 and i % 7 == 0 } #=> nil
+ * (1..10).find { |i| i % 5 == 0 and i % 7 == 0 } #=> nil
+ * (1..100).detect { |i| i % 5 == 0 and i % 7 == 0 } #=> 35
* (1..100).find { |i| i % 5 == 0 and i % 7 == 0 } #=> 35
*
*/