diff options
author | zverok <zverok.offline@gmail.com> | 2019-10-26 14:02:59 +0300 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-10-27 18:57:39 +0900 |
commit | 417369e0cd6ec96950d2d48f2c94e7b1eb012076 (patch) | |
tree | 9e3a5ff0c1a3ffd5cbfb797638454b2cee4ae6c7 /NEWS | |
parent | aba23d83f2697247488a2e770fcb9ce5abfcd16c (diff) | |
download | ruby-417369e0cd6ec96950d2d48f2c94e7b1eb012076.tar.gz |
Improve Enumerator.produce docs
* Add to NEWS;
* Add examples of while-alike cycles with practical tasks.
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -248,6 +248,13 @@ Enumerator:: New methods:: + * Added Enumerator.produce to generate Enumerator from any custom + data-transformation. [Feature #14781] + + require 'date' + dates = Enumerator.produce(Date.today, &:succ) #=> infinite sequence of dates + dates.detect(&:tuesday?) #=> next tuesday + * Added Enumerator::Lazy#eager that generates a non-lazy enumerator from a lazy enumerator. [Feature #15901] |