Class


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);

Methods

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

Method Detail

[Static] create(properties:Object):Object
Create a class based on the parameters, properties and methods specified.
parameters
properties:Object — Properties and methods to create the class.
  • Extends - Designed to inherit the parent class.
  • Mixes - Specifies mixed member collection object.
  • Statics - Static property or method specified class.
  • constructor - The constructor of specified class.
  • Other members of the property or method to create the class.
return
Object — Create classes.
[Static] mix(target:Object, source:Object):Object
Mixed property or method.
parameters
target:Object — Mixed audiences.
source:Object — The source whose methods and properties are to be mixed. It can support multiple source parameters.
return
Object — Mixed audiences.