class Shoulda::Matchers::ActiveModel::NumericalityMatchers::Submatchers

@private

def add(submatcher)

def add(submatcher)
  @submatchers << submatcher
end

def failing_submatcher

def failing_submatcher
  failing_submatchers.last
end

def failing_submatchers

def failing_submatchers
  @_failing_submatchers ||= @submatchers.reject do |submatcher|
    submatcher.matches?(@subject)
  end
end

def failure_message

def failure_message
  failing_submatcher.failure_message
end

def failure_message_when_negated

def failure_message_when_negated
  non_failing_submatcher.failure_message_when_negated
end

def initialize(submatchers)

def initialize(submatchers)
  @submatchers = submatchers
end

def matches?(subject)

def matches?(subject)
  @subject = subject
  failing_submatchers.empty?
end

def non_failing_submatcher

def non_failing_submatcher
  non_failing_submatchers.last
end

def non_failing_submatchers

def non_failing_submatchers
  @_non_failing_submatchers ||= @submatchers.reject do |submatcher|
    submatcher.does_not_match?(@subject)
  end
end