Skip to content

Instantly share code, notes, and snippets.

@benvanstaveren
Created October 14, 2011 20:57
Show Gist options
  • Save benvanstaveren/1288311 to your computer and use it in GitHub Desktop.
Save benvanstaveren/1288311 to your computer and use it in GitHub Desktop.
var myClass = new MooseClassFactory()
.name('MyMooseClass')
.with(['SomeRandomRole', 'SomeOtherRole' ])
.extends('MyOtherMooseClass')
.has('foo', { is: 'ro', isa: 'Str', required: true })
.has('bar', { is: 'rw', isa: 'Str', required: true, defaultValue: function() { return "foo " + " bar" } })
.method('fweep', function() {
say("fweeping up a storm!");
})
.makeImmutable;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment