-
Notifications
You must be signed in to change notification settings - Fork 7
phyloschema
Mark T. Holder edited this page Sep 14, 2014
·
3 revisions
This class (importable from peyotl.nexson_syntax
) provides a simple container for holding the set of variables needed to convert from one format to another (with error checking).
The primary motivation for this class is to:
- generate type conversion errors up front when some one requests a particular coercion. For example, this allows the phylesystem api to raise an error before it fetches the data in cases in which the user is requesting a format/content combination is not currently supported (or not possible)
- allow that agreed-upon coercion to be done later with a simple call to convert or serialize. So the class acts like a closure that can transform any nexson to the desired format (if NexSON has the necessary content)