Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/rr/core_ext/array.rb

Instance Method Summary collapse

Instance Method Details

#wildcard_match?(other) ⇒ Boolean

Returns:

  • (Boolean)


2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/rr/core_ext/array.rb', line 2

def wildcard_match?(other)
  return false unless other.is_a?(Array)
  return false unless size == other.size

  each_with_index do |value, i|
    if value.respond_to?(:wildcard_match?)
      return false unless value.wildcard_match?(other[i])
    else
      return false unless value == other[i]
    end
  end
end