From: "prijutme4ty (Ilya Vorontsov)" Date: 2012-06-02T23:15:40+09:00 Subject: [ruby-core:45384] [ruby-trunk - Feature #6532][Open] More methods for Hash and Array: Hash#has_all_keys? and family, Array#delete_at for multiple arguments Issue #6532 has been reported by prijutme4ty (Ilya Vorontsov). ---------------------------------------- Feature #6532: More methods for Hash and Array: Hash#has_all_keys? and family, Array#delete_at for multiple arguments https://bugs.ruby-lang.org/issues/6532 Author: prijutme4ty (Ilya Vorontsov) Status: Open Priority: Normal Assignee: Category: Target version: I suggest introducing Hash methods: has_all_keys?, has_any_key?, has_none_key?, has_one_key? to write: input.has_all_keys? %w{A C G T} instead of: %w{A C G T}.all?{|letter| input.has_key? letter} and to write args.has_one_key?(:input_file, :input_string, :input_from_another_source, ...) instead of obvious but verbose code with iterating through keys Also I suggest reimplement method Array#delete_at to work with multiple keys: def delete_at(*args) args.sort.reverse{|index| current_version_of_delete_at index} end It helps not only writing multiple deletion code faster but also prevents mistakes with deleting elements from an array in arbitrary order -- http://bugs.ruby-lang.org/