Sha256: 6e96861675a96a1f4330f7ee834ddc0e3f69f88f70db3b8ef7ab71d35f8164d3
Contents?: true
Size: 655 Bytes
Versions: 17
Compression:
Stored size: 655 Bytes
Contents
# frozen_string_literal: true if Lite::Ruby.configuration.monkey_patches.include?('range') class Range def combine(other) to_a.concat(other.to_a) end def include_with_range?(other) return include?(other) unless other.is_a?(Range) operator = exclude_end? && !other.exclude_end? ? :< : :<= include?(other.first) && other.last.send(operator, last) end def overlaps?(other) cover?(other.first) || other.cover?(first) end def sample to_a.sample end def shuffle to_a.shuffle end def within?(other) cover?(other.first) && cover?(other.last) end end end
Version data entries
17 entries across 17 versions & 1 rubygems