-
Notifications
You must be signed in to change notification settings - Fork 21.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 9420de5. Reason: Turns out we want to keep this method.
- Loading branch information
1 parent
cb01246
commit b5c3502
Showing
4 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
activesupport/lib/active_support/core_ext/array/inquiry.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters