Class: Shoulda::Matchers::ActiveModel::ValidationMatcher::BuildDescription
- Inherits:
-
Object
- Object
- Shoulda::Matchers::ActiveModel::ValidationMatcher::BuildDescription
- Defined in:
- lib/shoulda/matchers/active_model/validation_matcher/build_description.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(matcher, main_description) ⇒ BuildDescription
constructor
A new instance of BuildDescription.
Constructor Details
#initialize(matcher, main_description) ⇒ BuildDescription
Returns a new instance of BuildDescription.
11 12 13 14 |
# File 'lib/shoulda/matchers/active_model/validation_matcher/build_description.rb', line 11 def initialize(matcher, main_description) @matcher = matcher @main_description = main_description end |
Class Method Details
.call(matcher, main_description) ⇒ Object
7 8 9 |
# File 'lib/shoulda/matchers/active_model/validation_matcher/build_description.rb', line 7 def self.call(matcher, main_description) new(matcher, main_description).call end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/shoulda/matchers/active_model/validation_matcher/build_description.rb', line 16 def call if description_clauses_for_qualifiers.any? "#{main_description}#{clause_for_allow_blank_or_nil},"\ " #{description_clauses_for_qualifiers.to_sentence}" else main_description + clause_for_allow_blank_or_nil end end |