Skip to content

Instantly share code, notes, and snippets.

View canonic-epicure's full-sized avatar
💭
Well-typed API for the world

Nickolay Platonov canonic-epicure

💭
Well-typed API for the world
View GitHub Profile
Class('Some.Class', {
has : {
attr : {
meta : Vero.Attribute,
is : 'rw'
}
}
Class('My.Attribute', {
meta : Joose.Meta.Class,
isa : Joose.Managed.Attribute,
methods : {
getSetter : function () {
},
Class('Some.Class', {
trait : 'JooseX.Method.Remote.HTTP', // will include JooseX.CPS
has : {
attr : null
},
methods : {
require('Task/Joose/NodeJS')
var puts = require('sys').puts
Joose.Class('Class1', {
//use : [ 'Class2' ],
has : {
myAttr : {
// works
{
"id":"/lang",
"type":"/type/namespace",
"unique":null
}
// fails
var a = 1
doSomething1()
if (a) {
var b
doSomething2()
}
Class('Custom.Property', {
isa : Joose.Managed.Property,
does : Some.Role
// wrong, as Custom.Property will have the same meta-class as Joose.Managed.Property
// which is on 1st level and don't know what Role is
})
Class('Custom.Property', {
require('Task/Joose/NodeJS')
var puts = require('sys').puts
Class('Some.Class', {
has : {
attrib : {
is : 'rw',
require('Task/Joose/NodeJS')
var puts = require('sys').puts
Class('Some.Class', {
has : {
attrib : {
is : 'rw',
Class("My.Class", {
use: ["Some.Module"], // trigger async loading
body : function (m) {
// m == this == My.Class here
// class will be ready here
}})