I\'ve got the following logic in my code:
if !@players.include?(p.name) ... end
@players is an array. Is there a method so
@players
if @players.exclude?(p.name) ... end
ActiveSupport adds the exclude? method to Array, Hash, and String. This is not pure Ruby, but is used by a LOT of rubyists.
Array
Hash
String
Source: Active Support Core Extensions (Rails Guides)