Module hilo/core/Class
Source
Class.js
Class Class is created to aid the developer.
Create Example Class:
var Bird = Hilo.Class.create({
Extends: Animal,
Mixes: EventMixin,
constructor: function(name){
this.name = name;
},
fly: function(){
console.log('I am flying');
},
Statics: {
isBird: function(bird){
return bird instanceof Bird;
}
}
});
var swallow = new Bird('swallow');
swallow.fly();
Bird.isBird(swallow);
| Method | Defined | |
|---|---|---|
|
create(properties:Object):Object
static
Create a class based on the parameters, properties and methods specified.
|
Class | |
|
mix(target:Object, source:Object):Object
static
Mixed property or method.
|
Class |