Become ruby developer once again
`#{1} + 1``num + 1``Opal.SomeNamespace.SomeClass``obj.$method()``obj.instance_variable`| Minified | Gzipped | |
|---|---|---|
| Opal Runtime | 148KB | 35KB |
| Sugar.js | 49KB | 18KB |
| Underscore.js | 14KB | 5KB |
Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.
Any sufficiently complicated Javascript program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Ruby.
Document.ready? doel = Element['#id']el.value = 'my input'el.on(:click) do |e| e.prevent_default el.add_class('clicked') endHTTP.get("/users.json") do |response| if response.ok? puts response.json else puts response.body end endend
`el.resizable({
helper: "ui-resizable-helper"
});`
class Element
def resizable(options = {})
`this.resizable(#{options})`
end
end
class MyView < Viewtemplate :li do div model.name, class: 'name' endon :click do model.name = 'Opal' endrender do el.resizable enddef initialize(options = {}) super model.on(:change) { render } endendElement['#container'].append MyView.new.render
class MyModel < Modelstring :name integer :ageembeds :children, MyCollectionendclass MyCollection < Collection child ChildClass end