method

values_at

v1_9_3_392 - Show latest stable - Class: Struct
values_at(*args)
public

Returns an array containing the elements in self corresponding to the given selector(s). The selectors may be either integer indices or ranges. See also .select.

a = %w{ a b c d e f }
a.values_at(1, 3, 5)
a.values_at(1, 3, 5, 7)
a.values_at(-1, -3, -5, -7)
a.values_at(1..3, 2...5)