Class: Avo::ErrorManager

Inherits:
Object
  • Object
show all
Defined in:
lib/avo/error_manager.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeErrorManager

Returns a new instance of ErrorManager.



13
14
15
# File 'lib/avo/error_manager.rb', line 13

def initialize
  @errors = []
end

Instance Attribute Details

#errorsObject (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

.buildObject



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

Returns:

  • (Boolean)


21
22
23
# File 'lib/avo/error_manager.rb', line 21

def has_errors?
  @errors.present?
end