個人的なイメージです。
要素それぞれ: each
/reverse_each
/cycle
/each_entry
要素それぞれと付随物を: each_with_index
/each_with_object
要素を元とした配列: map
(collect
)/flat_map
合わせた配列: zip
畳み込み: inject
(reduce
)
条件を満たすか: all?
/any?
/one?
/none?
要素に含まれているか: include?
(member?
)
要素を一つ探す: find
(detect
)/find_index
一定数毎に要素区分け: each_cons
/each_slice
先頭から抜き出し/叩き落とした配列: first
/drop
/drop_while
/take
/take_while
条件を満たす要素を抜き出した配列: select
(find_all
)/reject
/partition
/grep
条件がキー、条件を満たす要素が配列の値にしたハッシュ: group_by
条件を満たす要素で区分け: chunk
/slice_before
/slice_after
/slice_when
最大最小: max
/min
/minmax
/max_by
/min_by
/minmax_by
並べ替え: sort
/sort_by
変換: to_a
(entries
)/to_h
数え上げ: count
遅延評価: lazy
関連: