lib/revenc/errors.rb in revenc-0.1.3 vs lib/revenc/errors.rb in revenc-0.2.1
- old
+ new
@@ -18,19 +18,19 @@
end
error_on_str = error_on_str.gsub(/\//, '_')
error_on_str = error_on_str.gsub(/_/, ' ')
error_on_str = error_on_str.gsub(/^revenc/, '').strip
#error_on_str = error_on_str.capitalize
-
+
@errors[error_on_str] ||= []
@errors[error_on_str] << message.to_s
end
def empty?
@errors.empty?
end
-
+
def clear
@errors = {}
end
def each
@@ -38,10 +38,10 @@
end
def size
@errors.values.inject(0) { |error_count, attribute| error_count + attribute.size }
end
-
+
alias_method :count, :size
alias_method :length, :size
def messages
messages = []