# Plugin Design - Analyses

Description | Attributes | Arbitrary Text | Statistics | See Also

## Description

Draco includes a specialized class to aid in creating analysis plugins. The class, Plugin::AnalysisPluginSkeleton, is meant to simplify the generation of results for analyses that calculate statistics or create arbitrary text output.

## Necessary Attributes

Analysis plugins are expected to assign values to attributes during calculations for results generation. The attributes are defined as follows:

Attribute | Expected Type | Description
@failure | string or nil | A string if the regression failed containing the reason, or nil otherwise
@statistics | array of arrays | An array of two-element arrays containing a statictic name and a value (see below)
@text | string or nil | Arbitrary text that should be output with the results (see below)

## Arbitrary Text

The attribute @text can be set during computations to include arbitrary text or html. For example, a message concerning the output might be generated. Alternatively, the author may choose to generate html to be output in line with the rest of the results. Due to the indefinite nature of possible analysis plugins, this field is present to allow arbitrary output, from text to tables, wherever appropriate.

## Assigning Statistics

Statistics can be added to results via calls to the statistic method. The method is used as follows:
`statistic name, value`
The name should be the plain text name of the statistic to display, and value should be a numeric result.

## See Also

Plugin Design - Necessities
Plugin System Technical

Copyright © 2009 Approximatrix, LLC
Text licensed under the Creative Commons Attribution-Share Alike 3.0 License
DracoTM and the Approximatrix logo are trademarks of Approximatrix, LLC
Other trademarks are property of their respective owners