class Array

Extend with some convenience methods

Public Instance Methods

longest_common_prefix(other) click to toggle source

Find the longest common prefix of two arrays @return [Array<Object>]

# File lib/nose/util.rb, line 51
def longest_common_prefix(other)
  fail TypeError unless other.is_a? Array
  (prefixes.to_a & other.prefixes.to_a).max_by(&:length) || []
end