   # @return [Object] the error object created and added to storage
   add: (attribute, code, detail = '') ->
     @__errors[attribute] ||= []
-    @__errors[attribute].push(error = { code: code, detail: detail })
+    @__errors[attribute].push(error = { code: code, detail: detail, message: detail })
     error
+
+  # Indicates whether or not the error with code `code` is on the `attribute`
+  #
+  # @param [String] attribute the attribute to check if the error exists on
+  # @param [String] code the code to check for on the attribute
+  # @return [Boolean] whether or not the error with code is on the attribute
+  added: (attribute, code) ->
+    ActiveResource::Collection.build(@__errors[attribute]).detect((e) -> e.code == code)?
+
+  # Indicates whether or not there are errors for a specific attribute
+  #
+  # @param [String] attribute the attribute to see if there are errors for
+  # @return [Boolean] whether or not the attribute has errors
+  include: (attribute) ->
+    @__errors[attribute]? && _.size(@__errors[attribute]) > 0
 
   # Indicates whether or not the errors object is empty
   #
   # @return [Boolean] whether or not the errors object is empty
   empty: ->
-    empty = true
-    for k,v of @__errors
-      empty = empty && !v.length
-    empty
+    @size() == 0
+
+  # Indicates the size of the errors array
+  #
+  # @return [Integer] the number of errors
+  size: ->
+    _.size(@toArray())
+
+  # Delete the errors for a specific attribute
+  #
+  # @param [String] attribute the attribute to delete errors for
+  delete: (attribute) ->
+    @__errors[attribute] = []
+
+  # Iterates over each error key, value pair in the errors object
+  # using a provided iterator that takes in two arguments (attribute, error)
+  #
+  # @example
+  #   resource.errors().each (attribute, error) ->
+  #     # Will yield 'name' and { code: '...', message: '...' }
+  #     # Then, will yield 'name' and { code: '...', message: '...' }
+  #
+  # @param [Function] iterator the function to use to iterate over errors
+  each: (iterator) ->
+    _.each @__errors, (errors, attribute) ->
+      iterator(attribute, error) for error in errors
 
   # Returns the error object for an attribute
   #

  # @return [Object] the error object for the attribute
  forAttribute: (attribute) ->
    ActiveResource::Collection.build(@__errors[attribute]).inject {}, (out, error) ->
      out[error.code] = error.detail
      out

  # Returns the error object for base

  # @return [Object] the error object for base
  forBase: ->
    @forAttribute('base')

  # Converts the errors object to an array of errors
  #
  # @return [Array] the errors object converted to an array of errors
  toArray: ->
    output = []
    for attribute, errors of @__errors
      output.push errors...

    output

  # Convert the errors object to a collection of errors
  #
  # @return [Collection] the errors object converted to a collection of errors
  toCollection: ->
    ActiveResource::Collection.build(@toArray())
