Class: Avo::ErrorManager
- Inherits:
-
Object
- Object
- Avo::ErrorManager
- Defined in:
- lib/avo/error_manager.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
(also: #all)
readonly
Returns the value of attribute errors.
Class Method Summary collapse
Instance Method Summary collapse
- #add(error) ⇒ Object
- #has_errors? ⇒ Boolean
-
#initialize ⇒ ErrorManager
constructor
A new instance of ErrorManager.
Constructor Details
#initialize ⇒ ErrorManager
Returns a new instance of ErrorManager.
13 14 15 |
# File 'lib/avo/error_manager.rb', line 13 def initialize @errors = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly) Also known as: all
Returns the value of attribute errors.
9 10 11 |
# File 'lib/avo/error_manager.rb', line 9 def errors @errors end |
Class Method Details
.build ⇒ Object
4 5 6 |
# File 'lib/avo/error_manager.rb', line 4 def build new end |
Instance Method Details
#add(error) ⇒ Object
17 18 19 |
# File 'lib/avo/error_manager.rb', line 17 def add(error) @errors << error end |
#has_errors? ⇒ Boolean
21 22 23 |
# File 'lib/avo/error_manager.rb', line 21 def has_errors? @errors.present? end |