Sha256: 1b4df592671852ba990f6f28a0bf179d9c269dd90b7e598194dce9967a9c067e

Contents?: true

Size: 424 Bytes

Versions: 6

Compression:

Stored size: 424 Bytes

Contents

require 'core_ext/array_inquirer'

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
    CoreExt::ArrayInquirer.new(self)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
core_ext-0.0.6 lib/core_ext/array/inquiry.rb
core_ext-0.0.5 lib/core_ext/array/inquiry.rb
core_ext-0.0.4 lib/core_ext/array/inquiry.rb
core_ext-0.0.3 lib/core_ext/array/inquiry.rb
core_ext-0.0.2 lib/core_ext/array/inquiry.rb
core_ext-0.0.1 lib/core_ext/array/inquiry.rb