smutbook:classes:api:defineobj
defineObj( id, objectClass=PersistentObject, defaults={} )
Define an object in the defaults datastore. Redefinition is not allowed.
Defined inL Persistence/PersistentObject.js
Type: Function
Arguments:
id: A unique string id for this object. A-Za-z0-9_ are allowed.
objectClass: The class of the object. This must be SmutBook.Persistence.PersistentObject or a subclass thereof.
defaults: A key-value set defining the default field values of this object.
Returns: a Proxy-wrapped instantiation of the defined object.
Throws: Error if an object of the given id has already been defined.
smutbook/classes/api/defineobj.txt · Last modified: by lee