Class: Mako::Errors
- Inherits:
-
Object
- Object
- Mako::Errors
- Defined in:
- lib/mako/errors.rb
Instance Attribute Summary collapse
-
#messages ⇒ Object
Returns the value of attribute messages.
Instance Method Summary collapse
-
#add_error(msg) ⇒ Object
Add an error message to the messages array.
-
#any? ⇒ Boolean
Predicate method to see if there are any error messages.
-
#initialize ⇒ Errors
constructor
A new instance of Errors.
Constructor Details
#initialize ⇒ Errors
Returns a new instance of Errors.
7 8 9 |
# File 'lib/mako/errors.rb', line 7 def initialize @messages = [] end |
Instance Attribute Details
#messages ⇒ Object
Returns the value of attribute messages.
5 6 7 |
# File 'lib/mako/errors.rb', line 5 def @messages end |
Instance Method Details
#add_error(msg) ⇒ Object
Add an error message to the messages array
14 15 16 |
# File 'lib/mako/errors.rb', line 14 def add_error(msg) << msg end |
#any? ⇒ Boolean
Predicate method to see if there are any error messages
21 22 23 |
# File 'lib/mako/errors.rb', line 21 def any? .count.positive? end |