Skip to content

Instantly share code, notes, and snippets.

@canonic-epicure
Created November 27, 2009 09:23
Show Gist options
  • Save canonic-epicure/243923 to your computer and use it in GitHub Desktop.
Save canonic-epicure/243923 to your computer and use it in GitHub Desktop.
Class('Name', {
//usual methods
does : {},
has : {}
methods : {},
//class methods/attributes
my : {
does : {},
has : {}
methods : {},
}
})
Name.my.someMethod()
var name = new Name()
name.my.someMethod()
//=========================
Class('Name', {
singleton : true,
does : {},
has : {}
methods : {},
})
var a = new Name()
var b = new Name()
var c = Name()
a == b == c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment