You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: spec_helper.rb
    path of file: ./repos/jruby/spec/ruby/library/matrix
    
    the code of the file until where you have to start completion: class BeCloseToMatrixMatcher
  def initialize(expected, tolerance = TOLERANCE)
    SpecExpectation.matcher! rescue "Used with the balance_should_and_match branch of mspec"
    @expected = Matrix[*expected]
    @tolerance = tolerance
  end

  def matches?(actual)
    @actual = actual
    return false unless @actual.is_a? Matrix
    return false unless @actual
    
  def matches?(actual)
    @actual = actual
    return false unless @actual.is_a? Matrix
    return false unless @actual.row_size == @expected.row_size
    @actual.row_size.times do |i|
      a, e = @actual.row(i), @expected.row(i)
      return false unless a.size == e.size
      a.size.times do |j|
        return false unless (a[j] - e[j]).abs < @tolerance
      end
    end
    true
  end