Class: Shoulda::Matchers::ActiveModel::AllowValueMatcher::AttributeSetterAndValidator
- Inherits:
-
Object
- Object
- Shoulda::Matchers::ActiveModel::AllowValueMatcher::AttributeSetterAndValidator
- Extended by:
- Forwardable
- Defined in:
- lib/shoulda/matchers/active_model/allow_value_matcher/attribute_setter_and_validator.rb
Instance Method Summary collapse
- #attribute_setter ⇒ Object
- #attribute_setter_description ⇒ Object
-
#initialize(allow_value_matcher, attribute_name, value) ⇒ AttributeSetterAndValidator
constructor
A new instance of AttributeSetterAndValidator.
- #validator ⇒ Object
Constructor Details
#initialize(allow_value_matcher, attribute_name, value) ⇒ AttributeSetterAndValidator
Returns a new instance of AttributeSetterAndValidator.
22 23 24 25 26 27 28 |
# File 'lib/shoulda/matchers/active_model/allow_value_matcher/attribute_setter_and_validator.rb', line 22 def initialize(allow_value_matcher, attribute_name, value) @allow_value_matcher = allow_value_matcher @attribute_name = attribute_name @value = value @_attribute_setter = nil @_validator = nil end |
Instance Method Details
#attribute_setter ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/shoulda/matchers/active_model/allow_value_matcher/attribute_setter_and_validator.rb', line 30 def attribute_setter @_attribute_setter ||= AttributeSetter.new( matcher_name: :allow_value, object: instance, attribute_name: attribute_name, value: value, ignore_interference_by_writer: ignore_interference_by_writer, after_set_callback: after_setting_value_callback, ) end |
#attribute_setter_description ⇒ Object
41 42 43 |
# File 'lib/shoulda/matchers/active_model/allow_value_matcher/attribute_setter_and_validator.rb', line 41 def attribute_setter_description attribute_setter.description end |