def add(val, options = {})
      item_key = (options[:as] || val).to_sym

      self[item_key] = val

      @options[item_key] = options
    end
def add(val, options = {})
      item_key = (options[:as] || val).to_sym

      self[item_key] = val

      @options[item_key] = options
    end
Adds a field to the api template

 The value passed can be one of the following:
  * Symbol - the method with the same name will be called on the model when rendering.
  * String - must be in the form "method1.method2.method3", will call this method chain.
  * Hash - will be added as a sub hash and all its items will be resolved the way described above.

 Possible options to pass:
  * :template - Determine the template that should be used to render the item if it is
    +api_accessible+ itself.