mirror of
https://github.com/flynx/object.js.git
synced 2025-10-29 18:40:08 +00:00
doc updates...
This commit is contained in:
parent
57d9f3d2c9
commit
9525667270
5
.npmignore
Normal file
5
.npmignore
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
.npm*
|
||||||
|
*.vim
|
||||||
|
*.sw[po]
|
||||||
|
.git
|
||||||
|
npm-debug.log
|
||||||
BIN
.object.js.swp
Normal file
BIN
.object.js.swp
Normal file
Binary file not shown.
BIN
.package.json.swp
Normal file
BIN
.package.json.swp
Normal file
Binary file not shown.
30
README.md
Executable file → Normal file
30
README.md
Executable file → Normal file
@ -57,7 +57,29 @@ c instanceof A // -> true
|
|||||||
```
|
```
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var Base = object.makeConstructor()
|
var Base = object.Constructor('Base', {
|
||||||
|
get prop(){
|
||||||
|
return 123 },
|
||||||
|
method: function(){
|
||||||
|
console.log('Base.method()') },
|
||||||
|
|
||||||
|
// initializer...
|
||||||
|
__init__: function(){
|
||||||
|
this.base_attribute = 321
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
var Item = object.Constructor('Item', {
|
||||||
|
// inherit from BaseItem...
|
||||||
|
__proto__: Base.prototype,
|
||||||
|
|
||||||
|
__init__: function(){
|
||||||
|
// call the "super" method...
|
||||||
|
object.parent(this.__init__, this).call(this)
|
||||||
|
this.item_attribute = 333
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -83,10 +105,6 @@ mixinFlat(<root>, <object>, ...)
|
|||||||
makeConstructor(<name>, <prototype>)
|
makeConstructor(<name>, <prototype>)
|
||||||
makeConstructor(<name>, <class-prototype>, <prototype>)
|
makeConstructor(<name>, <class-prototype>, <prototype>)
|
||||||
-> <constructor>
|
-> <constructor>
|
||||||
|
|
||||||
makeConstructor(<name>, <init-function>)
|
|
||||||
makeConstructor(<name>, <class-prototype>, <init-function>)
|
|
||||||
-> <constructor>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -95,7 +113,7 @@ makeConstructor(<name>, <class-prototype>, <init-function>)
|
|||||||
|
|
||||||
[BSD 3-Clause License](./LICENSE)
|
[BSD 3-Clause License](./LICENSE)
|
||||||
|
|
||||||
Copyright (c) 2019, Alex A. Naanou,
|
Copyright (c) 2019, Alex A. Naanou,
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
<!-- vim:set ts=4 sw=4 spell : -->
|
<!-- vim:set ts=4 sw=4 spell : -->
|
||||||
3
object.js
Executable file → Normal file
3
object.js
Executable file → Normal file
@ -292,8 +292,5 @@ function Constructor(name, a, b){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* vim:set ts=4 sw=4 : */ return module })
|
* vim:set ts=4 sw=4 : */ return module })
|
||||||
|
|||||||
0
package.json
Executable file → Normal file
0
package.json
Executable file → Normal file
Loading…
x
Reference in New Issue
Block a user