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

@private

Public Class Methods

new(submatchers) click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/submatchers.rb, line 7
def initialize(submatchers)
  @submatchers = submatchers
end

Public Instance Methods

add(submatcher) click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/submatchers.rb, line 24
def add(submatcher)
  @submatchers << submatcher
end
failure_message() click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/submatchers.rb, line 16
def failure_message
  last_failing_submatcher.failure_message
end
failure_message_when_negated() click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/submatchers.rb, line 20
def failure_message_when_negated
  last_failing_submatcher.failure_message_when_negated
end
last_failing_submatcher() click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/submatchers.rb, line 28
def last_failing_submatcher
  failing_submatchers.last
end
matches?(subject) click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/submatchers.rb, line 11
def matches?(subject)
  @subject = subject
  failing_submatchers.empty?
end

Private Instance Methods

failing_submatchers() click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/submatchers.rb, line 34
def failing_submatchers
  @_failing_submatchers ||= @submatchers.reject do |submatcher|
    submatcher.matches?(@subject)
  end
end