Skip to content

Instantly share code, notes, and snippets.

@simonask
Created February 7, 2009 16:05
Show Gist options
  • Save simonask/59917 to your computer and use it in GitHub Desktop.
Save simonask/59917 to your computer and use it in GitHub Desktop.
SomeGenericClass: class(ThePrototype) {
.initialize: [a] {
.a: a
}
.attribute("attr", get: { .a }, set: { .a: it })
// Maybe this?
.attribute("a", get: { .get_member("a") }, set: { .set_member("a", it) })
}
instance: SomeGenericClass(123)
instance.attr //=> 123
instance.get_member("attr") //=> nil
instance.is_attribute("attr") //=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment