Skip to content

Commit 7dcec6f

Browse files
authored
Merge pull request rails#55371 from neilvcarvalho/nc-range-overlap-doc
Re-add `Range#overlap?` documentation
2 parents 1b08a81 + 8a3aae5 commit 7dcec6f

File tree

1 file changed

+3
-3
lines changed
  • activesupport/lib/active_support/core_ext/range

1 file changed

+3
-3
lines changed

activesupport/lib/active_support/core_ext/range/overlap.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# frozen_string_literal: true
22

33
class Range
4-
# Compare two ranges and see if they overlap each other
5-
# (1..5).overlap?(4..6) # => true
6-
# (1..5).overlap?(7..9) # => false
74
unless Range.method_defined?(:overlap?) # Ruby 3.3+
5+
# Compare two ranges and see if they overlap each other
6+
# (1..5).overlap?(4..6) # => true
7+
# (1..5).overlap?(7..9) # => false
88
def overlap?(other)
99
raise TypeError unless other.is_a? Range
1010

0 commit comments

Comments
 (0)