aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/range/include_range.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/range/include_range.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/range/include_range.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/core_ext/range/include_range.rb b/activesupport/lib/active_support/core_ext/range/include_range.rb
index a6b4e9ff64..cd53cf154a 100644
--- a/activesupport/lib/active_support/core_ext/range/include_range.rb
+++ b/activesupport/lib/active_support/core_ext/range/include_range.rb
@@ -1,13 +1,12 @@
module ActiveSupport #:nodoc:
module CoreExtensions #:nodoc:
module Range #:nodoc:
- # Check if a Range includes another Range
+ # Check if a Range includes another Range.
module IncludeRange
+ def self.included(base) #:nodoc:
+ base.alias_method_chain :include?, :range
+ end
- def self.included(klass) #:nodoc:
- klass.send(:alias_method_chain, :include?, :range)
- end
-
def include_with_range?(value)
if value.is_a?(::Range)
operator = exclude_end? ? :< : :<=
@@ -17,8 +16,7 @@ module ActiveSupport #:nodoc:
include_without_range?(value)
end
end
-
end
end
end
-end \ No newline at end of file
+end