Provides a simple and standard way to include class configuration options
new (require("king/lib/options"))(options)
Object class mixing which provides a standard way of defining configuration options on a class instance
Parameters:
| Name | Type | Description |
|---|---|---|
options |
Object | and object containing configutation overrides to set on the class instance |
Example
var X = Class({
mixin: [ Options ]
,options:{
"value1": 1
,"value2":2
}
, constructor: function( options ){
this.setOptions( options )
}
});
var x = new X({
"value1":2
,"value2"1
})
Requires
- module:prime
- module:mout/object/merge
- module:mout/array/append
Methods
-
<inner> setOptions(Options)
-
merges an object into existing instance options and stores them in an options property
Parameters:
Name Type Description OptionsObjecdt conifguration options to be merged into defaults
Returns:
- Type
- Object