Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created July 9, 2017 12:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save goofmint/99dc253439b931127648aaee39785e62 to your computer and use it in GitHub Desktop.
var AnimalClass = h5.cls.RootClass.extend(function (super_) {
return {
// クラス名(完全修飾名)
name: 'AnimalClass',
isAbstract: true,
// クラスのフィールド定義
field: {
_name: null
},
// クラスのメソッド定義
method: {
constructor: function (params) {
// 親クラスのコンストラクタ呼び出し
super_.constructor.call(this);
this._name = params;
},
hello: function() {
return this._name;
},
cry: function(name, voice) {
return name + "'s crying voice is " + voice;
}
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment