Sha256: 1e69f73c68dafadb8a71d32b41c35625dfaf28d9c8733515d43ba96341dfc027
Contents?: true
Size: 637 Bytes
Versions: 12
Compression:
Stored size: 637 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 sample to_a.sample end def shuffle to_a.shuffle end def within?(other) cover?(other.first) && cover?(other.last) end end require 'lite/ruby/safe/range' unless defined?(ActiveSupport) end
Version data entries
12 entries across 12 versions & 1 rubygems