Method: Array#inquiry
- Defined in:
- lib/active_support/core_ext/array/inquiry.rb
#inquiry ⇒ Object
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
16 17 18 |
# File 'lib/active_support/core_ext/array/inquiry.rb', line 16 def inquiry ActiveSupport::ArrayInquirer.new(self) end |