Class: Shoulda::Matchers::ActiveModel::NumericalityMatchers::Submatchers
- Inherits:
-
Object
- Object
- Shoulda::Matchers::ActiveModel::NumericalityMatchers::Submatchers
- Defined in:
- lib/shoulda/matchers/active_model/numericality_matchers/submatchers.rb
Instance Method Summary collapse
- #add(submatcher) ⇒ Object
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(submatchers) ⇒ Submatchers
constructor
A new instance of Submatchers.
- #matches?(subject) ⇒ Boolean
Constructor Details
#initialize(submatchers) ⇒ Submatchers
Returns a new instance of Submatchers.
7 8 9 |
# File 'lib/shoulda/matchers/active_model/numericality_matchers/submatchers.rb', line 7 def initialize(submatchers) @submatchers = submatchers end |
Instance Method Details
#add(submatcher) ⇒ Object
24 25 26 |
# File 'lib/shoulda/matchers/active_model/numericality_matchers/submatchers.rb', line 24 def add(submatcher) @submatchers << submatcher end |
#failure_message ⇒ Object
16 17 18 |
# File 'lib/shoulda/matchers/active_model/numericality_matchers/submatchers.rb', line 16 def failing_submatcher. end |
#failure_message_when_negated ⇒ Object
20 21 22 |
# File 'lib/shoulda/matchers/active_model/numericality_matchers/submatchers.rb', line 20 def non_failing_submatcher. end |
#matches?(subject) ⇒ Boolean
11 12 13 14 |
# File 'lib/shoulda/matchers/active_model/numericality_matchers/submatchers.rb', line 11 def matches?(subject) @subject = subject failing_submatchers.empty? end |