Fun fact: The XKCD site was hacked, and the second most common password used was "correct horse battery staple"
You can also use grep for === responding objects like Regexp:
@safe||=words.grep(SAFE_SET)
grep_v will do the inverse (because grep -v in Unix). As of Ruby 2.5 (iirc) the predicate methods (any?, all?, none?, one?) also take === responding objects directly.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Fun fact: The XKCD site was hacked, and the second most common password used was "correct horse battery staple"
You can also use
grepfor===responding objects likeRegexp:grep_vwill do the inverse (becausegrep -vin Unix). As of Ruby 2.5 (iirc) the predicate methods (any?,all?,none?,one?) also take===responding objects directly.