Skip to content

Instantly share code, notes, and snippets.

@canonic-epicure
Created June 25, 2010 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save canonic-epicure/452350 to your computer and use it in GitHub Desktop.
Save canonic-epicure/452350 to your computer and use it in GitHub Desktop.
Role('Method.Feature.Decorated')
Class('Method.Special', {
meta : JooseX.Meta.Class,
isa : Joose.Managed.Property.MethodModifier.Put,
does : Method.Feature.Decorated
})
Role('Method.Decoration', {
builder : {
my_methods : function (meta, info) {
Joose.O.eachOwn(info, function (value, name) {
meta.addMethod(name, value, { meta : Method.Special })
})
}
}
})
Class('Class.With.Decorated.Methods', {
trait : Method.Decorated,
my_methods : {
method1 : function () {
},
method2 : function () {
}
}
})
consumer.meta.getMethods().each(function (method, name) {
if (method.meta.does('Method.Feature.Decorated')) {
...
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment