The class type info object. It holds all registered class types with LRU-cache. The value of the class type is the object.
-
Self-consistent class system
-
Dynamic attributes inheritance
-
Parent class type load on demand.
-
Streamable attributes and methods.
-
Additional
- LRU-cache on classes.
- eventable on class, attribute and method loading.
Class = require('class-type')
# create a new Test Class
TestClass = Class 'TestClass',
Inherits: 'TheParentClassName'
constructor: (age)->@age=age # It could be a function string.
age: 0 # this is the default age.
# create an instance of TestClass.
test = TestClass.create(12)
assert.equal test.age, 12
See abstract-type.
-
Static Properties:
global
(object): the global object is the unique global environment[global environment] of the class system.classes
(LRUCache): the registered class types.
-
the attributes for class declaration:
Inherits
(String|ClassType|Ctor)constructor
(Function|StringFunction)
MIT