Class: SimpleRecord::SimpleRecord_errors

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_record.rb

Instance Method Summary collapse

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

#countObject



973
974
975
# File 'lib/simple_record.rb', line 973

def count
    return length
end

#full_messagesObject



985
986
987
# File 'lib/simple_record.rb', line 985

def full_messages
    return @errors
end

#lengthObject



977
978
979
# File 'lib/simple_record.rb', line 977

def length
    return @errors.length
end

#sizeObject



981
982
983
# File 'lib/simple_record.rb', line 981

def size
    return length
end