Project

General

Profile

Feature #14197

Updated by sawa (Tsuyoshi Sawada) over 4 years ago

`#all?`, `#any?`, `#none?`, and `#one?` accept a pattern arguments argument since 2.5.0. 
 But `#select`, and `#reject` don't. 

 The features are exist as `#grep`, and `#grep_v` have such feature, `#grep_v`, but it is there are hard to remember for me to remember them since when I would be thinking of using use `#select`, or `#reject`, and `#select` and `#reject` don't have such feature. `#reject`. 

 So I want to write 

 ```ruby 
 collection.reject(/re/) 
 ``` 

 instead of 

 ```ruby 
 collection.reject {|item| /re/ =~ item } 
 ``` 

 or nor 

 ```ruby 
 collection.grep_v(/re/) 
 ```

Back