Sha256: 7416ff6da74b1fc848c741af8625a8e14a1719cf1b3931a1ef31118136e2fb25
Contents?: true
Size: 637 Bytes
Versions: 9
Compression:
Stored size: 637 Bytes
Contents
# frozen_string_literal: true if Lite::Ruby.configuration.monkey_patches.include?('range') require 'lite/ruby/safe/range' unless defined?(ActiveSupport) 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 end
Version data entries
9 entries across 9 versions & 1 rubygems