Class: SimpleRecord::SimpleRecord_errors
- Inherits:
-
Object
- Object
- SimpleRecord::SimpleRecord_errors
- Defined in:
- lib/simple_record.rb
Instance Method Summary collapse
- #add(attribute, value) ⇒ Object
- #add_to_base(value) ⇒ Object
- #count ⇒ Object
- #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.
960 961 962 963 |
# File 'lib/simple_record.rb', line 960 def initialize(*params) super(*params) @errors=[] end |
Instance Method Details
#add(attribute, value) ⇒ Object
969 970 971 |
# File 'lib/simple_record.rb', line 969 def add(attribute, value) @errors+=["#{attribute.to_s} #{value}"] end |
#add_to_base(value) ⇒ Object
965 966 967 |
# File 'lib/simple_record.rb', line 965 def add_to_base(value) @errors+=[value] end |
#count ⇒ Object
973 974 975 |
# File 'lib/simple_record.rb', line 973 def count return length end |
#full_messages ⇒ Object
985 986 987 |
# File 'lib/simple_record.rb', line 985 def return @errors end |
#length ⇒ Object
977 978 979 |
# File 'lib/simple_record.rb', line 977 def length return @errors.length end |
#size ⇒ Object
981 982 983 |
# File 'lib/simple_record.rb', line 981 def size return length end |