Skip to content

Instantly share code, notes, and snippets.

@ELLIOTTCABLE
Created October 19, 2008 10:20
Show Gist options
  • Save ELLIOTTCABLE/17805 to your computer and use it in GitHub Desktop.
Save ELLIOTTCABLE/17805 to your computer and use it in GitHub Desktop.
VALUE whatever_we_are_calling_this(VALUE self) {
st_data_t value;
if(FL_TEST(klass, FL_SINGLETON)) st_lookup( RCLASS(self)->iv_tbl, rb_intern("__attached__"), &value );
else rb_raise(rb_eRuntimeError, "not a singleton");
return (VALUE) value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment