mixins/indexable_container |
module IndexableContainer |
Public Methods |
Create a new array populated with values for the given keys.
keys | the list of keys to use to populate the array. |
---|
Returns: an array populated with values for the given keys.
Find the key (or index) for a given value.
value | the value to search for |
---|
Returns: a key (or index) that matches the given value. If none is found, returns the default value (or if the container has no default value, returns nil). If there are multiple keys that match the value, then the result is indeterminate.
indices is an alias for indexes.
Enumerate through all elements in a container, yielding the key (or index) for the each element.
Returns: the last value from the last call to yield.