Entitas::Helper::Entities(TEntity)
Instance methods
each
Sourcesort
Returns a new array with all elements sorted based on the comparator in the given block.
The block must implement a comparison between two elements a and b,
where a < b returns -1, a == b returns 0, and a > b returns 1.
The comparison operator <=> can be used for this.
a = [3, 1, 2]
b = a.sort { |a, b| b <=> a }
b # => [3, 2, 1]
a # => [3, 1, 2]