From 5253b9579a129f66a768dae24bd50a95bab02841 Mon Sep 17 00:00:00 2001 From: Victor Shepelev Date: Mon, 21 Dec 2020 02:32:30 +0200 Subject: Document usage of ArithmeticSequence in Array#slice, and add to NEWS (#3952) --- NEWS.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'NEWS.md') diff --git a/NEWS.md b/NEWS.md index d88642b71c..447788b932 100644 --- a/NEWS.md +++ b/NEWS.md @@ -149,6 +149,14 @@ Outstanding ones only. * Array#uniq * Array#* + * Can be sliced with Enumerator::ArithmeticSequence + + ```ruby + dirty_data = ['--', 'data1', '--', 'data2', '--', 'data3'] + dirty_data[(1..).step(2)] # take each second element + # => ["data1", "data2", "data3"] + ``` + * ConditionVariable * ConditionVariable#wait may now invoke the `block`/`unblock` scheduler -- cgit v1.2.3