From baf73e19a6f05fcb46c06d759b08f3cbe22ed1c9 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 21 Mar 2009 04:30:28 -0700 Subject: Convert Range extension module to a class reopen --- .../lib/active_support/core_ext/range/overlaps.rb | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'activesupport/lib/active_support/core_ext/range/overlaps.rb') diff --git a/activesupport/lib/active_support/core_ext/range/overlaps.rb b/activesupport/lib/active_support/core_ext/range/overlaps.rb index 43c69453e7..0dec6e0ac4 100644 --- a/activesupport/lib/active_support/core_ext/range/overlaps.rb +++ b/activesupport/lib/active_support/core_ext/range/overlaps.rb @@ -1,15 +1,8 @@ -module ActiveSupport #:nodoc: - module CoreExtensions #:nodoc: - module Range #:nodoc: - # Check if Ranges overlap. - module Overlaps - # Compare two ranges and see if they overlap eachother - # (1..5).overlaps?(4..6) # => true - # (1..5).overlaps?(7..9) # => false - def overlaps?(other) - include?(other.first) || other.include?(first) - end - end - end +class Range + # Compare two ranges and see if they overlap eachother + # (1..5).overlaps?(4..6) # => true + # (1..5).overlaps?(7..9) # => false + def overlaps?(other) + include?(other.first) || other.include?(first) end end -- cgit v1.2.3