JS.Class 2.1发布 Ruby风格的JavaScript免费下载
【资源属性】:资源名称:JS.Class 2.1发布 Ruby风格的JavaScript
资源大小:40KB
资源类别: js框架 》 其它框架
更新时间:2023-01-17
资源语言:简体中文
授权方式:免费下载
使用平台:Windows/Linux/Mac
下载地址:下载地址
资源介绍:
James Coglan不久前更新了JS.Class,发布了 JS.Class 2.1版本,使用JavaScript实现了Ruby的对象系统。
var Event = new JS.Class({
include: JS.Observable,
fire: function(data) {
this.notifyObservers('fire', data);
}
});
JS.Class is designed to make JavaScript behave like Ruby in terms of its OOP structures. To this end, it provides the following features:
Classes and modules with Ruby-compatible inheritance
Subclassing and mixins
Late-binding arguments-optional super calls to parent classes and mixins
Singleton methods and eigenclasses
included, extended and inherited hooks
Method binding
Ports of various standard Ruby modules, including Enumerable, Hash, Set, Observable, Comparable, Forwardable
Its inheritance system supports late-bound super() calls to parent classes and modules, including calls from singleton methods. It has been designed to mimick Ruby as closely as possible, so if you know Ruby you should feel right at home.
var Event = new JS.Class({
include: JS.Observable,
fire: function(data) {
this.notifyObservers('fire', data);
}
});
JS.Class is designed to make JavaScript behave like Ruby in terms of its OOP structures. To this end, it provides the following features:
Classes and modules with Ruby-compatible inheritance
Subclassing and mixins
Late-binding arguments-optional super calls to parent classes and mixins
Singleton methods and eigenclasses
included, extended and inherited hooks
Method binding
Ports of various standard Ruby modules, including Enumerable, Hash, Set, Observable, Comparable, Forwardable
Its inheritance system supports late-bound super() calls to parent classes and modules, including calls from singleton methods. It has been designed to mimick Ruby as closely as possible, so if you know Ruby you should feel right at home.