Issue #6532 has been updated by marcandre (Marc-Andre Lafortune).

Status changed from Open to Rejected

I've written a short wiki on making feature requests: http://bugs.ruby-lang.org/projects/ruby/wiki/HowToRequestFeatures
I'm inviting others to review and edit it...

I'm rejecting this feature request as it contains many different requests. Besides most of them appear to have been poorly thought out and researched. Please open new requests for those you still feel confident about, bearing in mind that:
- your `selection` is probably not useful given `values_at`
- your ruby implementation of delete_at is probably not what you meant (unless you meant that arr.delete_at(0,0,0) would delete the first, second and third element and that you didn't think about the return value of `delete_at`, which makes it unreasonable to extend how you request it
- you need to build a solid case for you has_*_keys? as there are many simple alternatives (e.g. using sets, (h.keys & %w[A C G T]).empty?, h.values_at(*%w[A C G T]).any? ...)
----------------------------------------
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#change-26980

Author: prijutme4ty (Ilya Vorontsov)
Status: Rejected
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/