Class: SimpleRecord::SimpleRecord_errors
- Inherits:
-
Object
- Object
- SimpleRecord::SimpleRecord_errors
- Defined in:
- lib/simple_record/errors.rb
Instance Method Summary collapse
- #add(attribute, value) ⇒ Object
- #add_to_base(value) ⇒ Object
- #clear ⇒ Object
- #count ⇒ Object
- #empty? ⇒ Boolean
- #full_messages ⇒ Object
-
#initialize(*params) ⇒ SimpleRecord_errors
constructor
A new instance of SimpleRecord_errors.
- #length ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize(*params) ⇒ SimpleRecord_errors
Returns a new instance of SimpleRecord_errors.
18 19 20 21 |
# File 'lib/simple_record/errors.rb', line 18 def initialize(*params) super(*params) @errors=[] end |
Instance Method Details
#add(attribute, value) ⇒ Object
27 28 29 |
# File 'lib/simple_record/errors.rb', line 27 def add(attribute, value) @errors+=["#{attribute.to_s} #{value}"] end |
#add_to_base(value) ⇒ Object
23 24 25 |
# File 'lib/simple_record/errors.rb', line 23 def add_to_base(value) @errors+=[value] end |
#clear ⇒ Object
47 48 49 |
# File 'lib/simple_record/errors.rb', line 47 def clear @errors.clear end |
#count ⇒ Object
31 32 33 |
# File 'lib/simple_record/errors.rb', line 31 def count return length end |
#empty? ⇒ Boolean
51 52 53 |
# File 'lib/simple_record/errors.rb', line 51 def empty? @errors.empty? end |
#full_messages ⇒ Object
43 44 45 |
# File 'lib/simple_record/errors.rb', line 43 def return @errors end |
#length ⇒ Object
35 36 37 |
# File 'lib/simple_record/errors.rb', line 35 def length return @errors.length end |
#size ⇒ Object
39 40 41 |
# File 'lib/simple_record/errors.rb', line 39 def size return length end |