method
indices
v1_8_6_287 -
Show latest stable
- Class:
Hash
indices(...)public
Deprecated in favor of Hash#select.
/*
* call-seq:
* hsh.indexes(key, ...) => array
* hsh.indices(key, ...) => array
*
* Deprecated in favor of <code>Hash#select</code>.
*
*/
static VALUE
rb_hash_indexes(argc, argv, hash)
int argc;
VALUE *argv;
VALUE hash;
{
VALUE indexes;
int i;
rb_warn("Hash#%s is deprecated; use Hash#values_at",
rb_id2name(rb_frame_last_func()));
indexes = rb_ary_new2(argc);
for (i=0; i<argc; i++) {
RARRAY(indexes)->ptr[i] = rb_hash_aref(hash, argv[i]);
RARRAY(indexes)->len++;
}
return indexes;
} Related methods
- Instance methods
- ==
- []
- []=
- clear
- default
- default=
- default_proc
- delete
- delete_if
- each
- each_key
- each_pair
- each_value
- empty?
- fetch
- has_key?
- has_value?
- include?
- index
- indexes
- indices
- initialize_copy
- inspect
- invert
- key?
- keys
- length
- member?
- merge
- merge!
- pretty_print
- pretty_print_cycle
- rehash
- reject
- reject!
- replace
- select
- shift
- size
- sort
- store
- to_a
- to_hash
- to_s
- to_yaml
- update
- value?
- values
- values_at
- yaml_initialize
- Class methods
- []
- new