Sha256: 5850c57a85c34e2773d41d1ba94c657eedf282a29f4ee9be441df2b186cd6c1d
Contents?: true
Size: 631 Bytes
Versions: 14
Compression:
Stored size: 631 Bytes
Contents
module ActiveObject::Range def combine(other) to_a.concat(other.to_a) end def include_with_range?(other) if other.is_a?(::Range) operator = exclude_end? && !other.exclude_end? ? :< : :<= include?(other.first) && other.last.send(operator, last) else include?(other) end 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 Range.include(ActiveObject::Range) if ActiveObject::Settings.config.autoload_range
Version data entries
14 entries across 14 versions & 1 rubygems