struct Range(B, E)

Overview

https://github.com/crystal-lang/crystal/pull/17081

Included Modules

Defined in:

ext/crystal/range.cr

Instance Method Summary

Instance Method Detail

def overlaps?(other : Range) : Bool #

Returns true if this range and other have at least one value in common.

(1..5).overlaps?(5..10)  # => true
(1...5).overlaps?(5..10) # => false
(1...1).overlaps?(1..1)  # => false