mirror of
https://github.com/mistergibson/gxg-web-client.git
synced 2026-08-15 03:26:00 -07:00
13 lines
328 B
Ruby
13 lines
328 B
Ruby
module Rubinius
|
|
module EnumerableHelper
|
|
def self.cycle_size(enum_size, many)
|
|
if many
|
|
many = Rubinius::Type.coerce_to_collection_index many
|
|
many = 0 if many < 0
|
|
(_size = enum_size).nil? ? nil : _size * many
|
|
else
|
|
enum_size.nil? ? nil : Float::INFINITY
|
|
end
|
|
end
|
|
end
|
|
end
|