Sha256: f0691417b226f351a69ad211243099b39eed3973084fb6fa42e29e9d65202b27
Contents?: true
Size: 446 Bytes
Versions: 18
Compression:
Stored size: 446 Bytes
Contents
module GitlabAwesomeRelease module ArrayWithinExt refine Array do def within(from_value, to_value) from_index = find_index(from_value) to_index = find_index(to_value) raise ArgumentError, "#{from_value} is not included in #{inspect}" unless from_index raise ArgumentError, "#{to_value} is not included in #{inspect}" unless to_index self[from_index..to_index] end end end end
Version data entries
18 entries across 18 versions & 1 rubygems