Class: ActiveModel::DeprecationHandlingMessageArray
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- ActiveModel::DeprecationHandlingMessageArray
- Defined in:
- activemodel/lib/active_model/errors.rb
Instance Method Summary collapse
- #<<(message) ⇒ Object
- #clear ⇒ Object
-
#initialize(content, errors, attribute) ⇒ DeprecationHandlingMessageArray
constructor
A new instance of DeprecationHandlingMessageArray.
Constructor Details
#initialize(content, errors, attribute) ⇒ DeprecationHandlingMessageArray
Returns a new instance of DeprecationHandlingMessageArray.
593 594 595 596 597 |
# File 'activemodel/lib/active_model/errors.rb', line 593 def initialize(content, errors, attribute) @errors = errors @attribute = attribute super(content.freeze) end |
Instance Method Details
#<<(message) ⇒ Object
599 600 601 602 603 604 605 |
# File 'activemodel/lib/active_model/errors.rb', line 599 def <<() ActiveSupport::Deprecation.warn("Calling `<<` to an ActiveModel::Errors message array in order to add an error is deprecated. Please call `ActiveModel::Errors#add` instead.") @errors.add(@attribute, ) __setobj__ @errors.(@attribute) self end |
#clear ⇒ Object
607 608 609 610 611 |
# File 'activemodel/lib/active_model/errors.rb', line 607 def clear ActiveSupport::Deprecation.warn("Calling `clear` to an ActiveModel::Errors message array in order to delete all errors is deprecated. Please call `ActiveModel::Errors#delete` instead.") @errors.delete(@attribute) end |