Last active
July 9, 2017 06:00
-
-
Save goofmint/e48153f8b5d49a35a0330f0177bb416e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AnimalClass = h5.cls.RootClass.extend(function (super_) { | |
return { | |
// クラス名(完全修飾名) | |
name: 'AnimalClass', | |
// クラスのフィールド定義 | |
field: { | |
_name: null, | |
_voice: 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