aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-03-27 16:25:13 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-03-27 16:25:13 -0300
commit9420de59f5b7f5ceac77e28e6c326ec145f71f80 (patch)
treedbe76919d5abd59d37d2837f05a9980e9183abac
parent5cb8e0046cf93d1e5468db8abb95a1f7b8a04b42 (diff)
downloadrails-9420de59f5b7f5ceac77e28e6c326ec145f71f80.tar.gz
rails-9420de59f5b7f5ceac77e28e6c326ec145f71f80.tar.bz2
rails-9420de59f5b7f5ceac77e28e6c326ec145f71f80.zip
Remove Array#inquiry
We are promoting too much a feature that will not be widler used. So for now lets keep just the ArrayInquirer constructor.
-rw-r--r--activesupport/CHANGELOG.md5
-rw-r--r--activesupport/lib/active_support/core_ext/array.rb1
-rw-r--r--activesupport/lib/active_support/core_ext/array/inquiry.rb15
-rw-r--r--activesupport/test/array_inquirer_test.rb7
4 files changed, 1 insertions, 27 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index 7eaad6340f..50045a8c17 100644
--- a/activesupport/CHANGELOG.md
+++ b/activesupport/CHANGELOG.md
@@ -1,4 +1,4 @@
-* Added `ActiveSupport::ArrayInquirer` and `Array#inquiry`.
+* Added `ActiveSupport::ArrayInquirer`.
Wrapping an array in an `ArrayInquirer` gives a friendlier way to check its
contents:
@@ -13,9 +13,6 @@
variants.any?(:phone, :desktop) # => true
variants.any?(:desktop, :watch) # => false
- `Array#inquiry` is a shortcut for wrapping the receiving array in an
- `ArrayInquirer`.
-
*George Claghorn*
* Deprecate `alias_method_chain` in favour of `Module#prepend` introduced in Ruby 2.0
diff --git a/activesupport/lib/active_support/core_ext/array.rb b/activesupport/lib/active_support/core_ext/array.rb
index 7551551bd7..7d0c1e4c8d 100644
--- a/activesupport/lib/active_support/core_ext/array.rb
+++ b/activesupport/lib/active_support/core_ext/array.rb
@@ -4,4 +4,3 @@ require 'active_support/core_ext/array/conversions'
require 'active_support/core_ext/array/extract_options'
require 'active_support/core_ext/array/grouping'
require 'active_support/core_ext/array/prepend_and_append'
-require 'active_support/core_ext/array/inquiry'
diff --git a/activesupport/lib/active_support/core_ext/array/inquiry.rb b/activesupport/lib/active_support/core_ext/array/inquiry.rb
deleted file mode 100644
index de623c466c..0000000000
--- a/activesupport/lib/active_support/core_ext/array/inquiry.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-class Array
- # Wraps the array in an +ArrayInquirer+ object, which gives a friendlier way
- # to check its string-like contents.
- #
- # pets = [:cat, :dog].inquiry
- #
- # pets.cat? # => true
- # pets.ferret? # => false
- #
- # pets.any?(:cat, :ferret) # => true
- # pets.any?(:ferret, :alligator) # => false
- def inquiry
- ActiveSupport::ArrayInquirer.new(self)
- end
-end
diff --git a/activesupport/test/array_inquirer_test.rb b/activesupport/test/array_inquirer_test.rb
index 488e0d34a9..97adea85e6 100644
--- a/activesupport/test/array_inquirer_test.rb
+++ b/activesupport/test/array_inquirer_test.rb
@@ -25,11 +25,4 @@ class ArrayInquirerTest < ActiveSupport::TestCase
def test_respond_to
assert_respond_to @array_inquirer, :development?
end
-
- def test_inquiry
- result = [:mobile, :tablet].inquiry
-
- assert_instance_of ActiveSupport::ArrayInquirer, result
- assert_equal @array_inquirer, result
- end
end