Class: MailForm::Errors
- Inherits:
-
Hash
- Object
- Hash
- MailForm::Errors
- Defined in:
- lib/mail_form/errors.rb
Instance Method Summary collapse
- #full_messages ⇒ Object
-
#initialize(base, *args) ⇒ Errors
constructor
A new instance of Errors.
- #on(attribute) ⇒ Object (also: #[])
Constructor Details
#initialize(base, *args) ⇒ Errors
Returns a new instance of Errors.
27 28 29 30 |
# File 'lib/mail_form/errors.rb', line 27 def initialize(base, *args) @base = base super(*args) end |
Instance Method Details
#full_messages ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/mail_form/errors.rb', line 44 def map do |attribute, | next if .nil? attribute = attribute.to_sym "#{@base.class.human_attribute_name(attribute)} #{(attribute, )}" end.compact.reverse end |
#on(attribute) ⇒ Object Also known as: []
36 37 38 39 40 41 |
# File 'lib/mail_form/errors.rb', line 36 def on(attribute) attribute = attribute.to_sym return nil unless get(attribute) (attribute, get(attribute)) end |