Class: Reaction::Errors
- Inherits:
-
Object
- Object
- Reaction::Errors
- Defined in:
- lib/reaction/errors.rb
Instance Attribute Summary collapse
-
#messages ⇒ Object
Returns the value of attribute messages.
Instance Method Summary collapse
- #add(key, message) ⇒ Object
- #any? ⇒ Boolean
- #clear ⇒ Object
- #each ⇒ Object
- #full_messages ⇒ Object
- #get(key) ⇒ Object
- #include?(key) ⇒ Boolean
-
#initialize ⇒ Errors
constructor
A new instance of Errors.
Constructor Details
#initialize ⇒ Errors
Returns a new instance of Errors.
6 7 8 |
# File 'lib/reaction/errors.rb', line 6 def initialize = {} end |
Instance Attribute Details
#messages ⇒ Object
Returns the value of attribute messages.
4 5 6 |
# File 'lib/reaction/errors.rb', line 4 def end |
Instance Method Details
#add(key, message) ⇒ Object
22 23 24 25 |
# File 'lib/reaction/errors.rb', line 22 def add(key, ) [key] ||= [] [key] << end |
#any? ⇒ Boolean
27 28 29 |
# File 'lib/reaction/errors.rb', line 27 def any? .any? end |
#clear ⇒ Object
10 11 12 |
# File 'lib/reaction/errors.rb', line 10 def clear .clear end |
#each ⇒ Object
31 32 33 |
# File 'lib/reaction/errors.rb', line 31 def each end |
#full_messages ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/reaction/errors.rb', line 35 def ret = [] .each do |key, values| values.each do |value| ret << "#{key}: #{value}" end end ret end |
#get(key) ⇒ Object
18 19 20 |
# File 'lib/reaction/errors.rb', line 18 def get(key) [key] end |
#include?(key) ⇒ Boolean
14 15 16 |
# File 'lib/reaction/errors.rb', line 14 def include?(key) ![key].nil? end |