Using Kinds in the Perl API
|
A number of methods provided with the Perl API deal with entity and reference kinds.
The $ent->kind() method returns an object of the Understand::Kind class. The following methods provided by that class allow you to obtain information about a kind:
- $kind->check() — Checks to see if the kind matches a kindstring filter.
Methods that accept a $kindstring or $entkindstring argument allow you to filter the results using an entity filter. The following methods accept such arguments:
- $db->ents() — Return a list of entities that match a kind.
- $db->lookup() — Return a list of entities that match a name and kind.
- $ent->ents() — Returns a list of entities that reference, or are referenced by, the entity.
- $ent->filerefs() — Returns a list of all references that occur in the specified file entity.
- $ent->ref() — Returns the first reference for the entity.
- Metric::list() — Returns a list of metric names for the specified kinds.
Methods that accept a $refkindstring argument allow you to filter the results using a reference filter. The following methods accept such a argument:
- $ent->comments() — Returns a formatted string based on the comments associated with an entity.
- $ent->ents() — Returns a list of entities that reference, or are referenced by, the entity.
- $ent->filerefs() — Returns a list of all references that occur in the specified file entity.
- $ent->ref() — Returns the first reference for the entity.
The following methods allow you to test kindname filters: