From ea6739544fd20659c281829d0ee4185642eab74f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yamamoto=20K=C5=8Dhei?= Date: Fri, 5 Nov 2021 23:16:44 +0900 Subject: [PATCH] Avoid a mixture of Array#filter and Array#select Although `Array#select` is an alias of `Array#filter`, it would be clearer to use either only `filter` or `select` in the examples for readers. --- docs/rbs_by_example.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/rbs_by_example.md b/docs/rbs_by_example.md index 7b9421c1f..d790ae599 100644 --- a/docs/rbs_by_example.md +++ b/docs/rbs_by_example.md @@ -229,9 +229,9 @@ end ```ruby # .rb -[1,2,3,4,5].select {|num| num.even? } +[1,2,3,4,5].filter {|num| num.even? } # => [2, 4] -%w[ a b c d e f ].select {|v| v =~ /[aeiou]/ } +%w[ a b c d e f ].filter {|v| v =~ /[aeiou]/ } # => ["a", "e"] [1,2,3,4,5].filter ```