Class: FactoryGirl::Attribute::NonAttributeWriterValidator Private
- Inherits:
-
Object
- Object
- FactoryGirl::Attribute::NonAttributeWriterValidator
- Defined in:
- lib/factory_girl/attribute.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#initialize(method_name) ⇒ NonAttributeWriterValidator
constructor
private
A new instance of NonAttributeWriterValidator.
- #validate! ⇒ Object private
Constructor Details
#initialize(method_name) ⇒ NonAttributeWriterValidator
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of NonAttributeWriterValidator.
36 37 38 39 |
# File 'lib/factory_girl/attribute.rb', line 36 def initialize(method_name) @method_name = method_name.to_s @method_name_setter_match = @method_name.match(/(.*)=$/) end |
Instance Method Details
#validate! ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 44 45 |
# File 'lib/factory_girl/attribute.rb', line 41 def validate! if method_is_writer? raise AttributeDefinitionError, end end |