Class: ActiveModel::Error
- Defined in:
- lib/reactive_record/active_record/error.rb
Instance Attribute Summary collapse
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Instance Method Summary collapse
- #[](attribute) ⇒ Object
- #delete(attribute) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(msgs = {}) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(msgs = {}) ⇒ Error
Returns a new instance of Error.
7 8 9 10 |
# File 'lib/reactive_record/active_record/error.rb', line 7 def initialize(msgs = {}) @messages = msgs || {} @messages.each { |attribute, | @messages[attribute] = .uniq } end |
Instance Attribute Details
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
5 6 7 |
# File 'lib/reactive_record/active_record/error.rb', line 5 def @messages end |
Instance Method Details
#[](attribute) ⇒ Object
12 13 14 |
# File 'lib/reactive_record/active_record/error.rb', line 12 def [](attribute) [attribute] end |
#delete(attribute) ⇒ Object
16 17 18 |
# File 'lib/reactive_record/active_record/error.rb', line 16 def delete(attribute) .delete(attribute) end |
#empty? ⇒ Boolean
20 21 22 |
# File 'lib/reactive_record/active_record/error.rb', line 20 def empty? .empty? end |