# Feature | Antville 1.4 API Reference

Documentation generator: JsDoc Toolkit 2.4.0
Template: Codeview 1.2
Generated on: 2012-4-22 10:17

# Class Feature

- Defined in: Feature.js

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| Feature(id, url, feature)

Field Summary
Field Attributes | Field Name and Description
--- | ---
| id The feature’s unique identifier.

## Method Summary

Method Attributes | Method Name and Description
--- | ---
<static> | Feature.add(id, url, feature) Adds a feature to the registry.
<static> | Feature.get(id) Retrieves a feature from the registry.
<static> | Feature.getPermission(action) Wrapper for the Feature._getPermission method.
<static> | Feature.invoke(id, callback) Invokes a (callback) function for a feauture.
<static> | Feature.list() Lists all available features in the registry.
<static> | Feature.remove(feature) Removes a feature from the registry.

## Class Detail

Feature(id, url, feature)

Parameters:
{String} id
  A unique identifier for the feature.
{String} url
  The URL of the website providing further information about the feature.
{Object} feature
  The initial properties of the feature.

## Field Detail

{String} id
The feature’s unique identifier.

## Method Detail

- <static> {Feature} Feature.add(id, url, feature)
  Adds a feature to the registry.
  Parameters:
  id
  url
  feature
  Returns:
    {Feature}
  See:
    Feature
- <static> {Feature} Feature.get(id)
  Retrieves a feature from the registry.
  Parameters:
  {String} id
    The identifier of the desired feature.
  Returns:
    {Feature}
- <static> {Boolean} Feature.getPermission(action)
  Wrapper for the Feature._getPermission method. All registered features will be evaluated.
  Parameters:
  {String} action
    The desired action to be invoked.
  Returns:
    {Boolean}
- <static> {Object} Feature.invoke(id, callback)
  Invokes a (callback) function for a feauture.
  Parameters:
  {String} id
    The identifier of the desired feature. '*' can be used to address all available features.
  {Function|String} callback
    The callback function or the name of method of the feature.
  Returns:
    {Object}
- <static> {Feature[]} Feature.list()
  Lists all available features in the registry.
  Returns:
    {Feature[]}
- <static> {Number} Feature.remove(feature)
  Removes a feature from the registry.
  Parameters:
  {Feature} feature
    The feature object to be removed.
  Returns:
    {Number} The resulting number of features still in the registry.