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 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 non_failing_submatcher.failure_message_when_negated 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_submatcher()
click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/submatchers.rb, line 42 def failing_submatcher failing_submatchers.last end
failing_submatchers()
click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/submatchers.rb, line 30 def failing_submatchers @_failing_submatchers ||= @submatchers.reject do |submatcher| submatcher.matches?(@subject) end end
non_failing_submatcher()
click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/submatchers.rb, line 46 def non_failing_submatcher non_failing_submatchers.last end
non_failing_submatchers()
click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/submatchers.rb, line 36 def non_failing_submatchers @_non_failing_submatchers ||= @submatchers.reject do |submatcher| submatcher.does_not_match?(@subject) end end