Skip to content

Instantly share code, notes, and snippets.

@aostrega
Created March 12, 2014 05:33
Show Gist options
  • Save aostrega/9501428 to your computer and use it in GitHub Desktop.
Save aostrega/9501428 to your computer and use it in GitHub Desktop.
Proposed solution to Opal issue #440
/* Generated by Opal 0.6.0 */
(function(ಠopal) {
var self = ಠopal.top, ಠscope = ಠopal, nil = ಠopal.nil, ಠbreaker = ಠopal.breaker, ಠslice = ಠopal.slice, ಠklass = ಠopal.klass, user = nil;
ಠopal.add_stubs(['ಠattr_accessor', 'ಠ==', 'ಠnew', 'ಠputs', 'ಠadmin?']);
(function(ಠbase, ಠsuper) {
function ಠUser(){};
var self = ಠUser = ಠklass(ಠbase, ಠsuper, 'User', ಠUser);
var def = self._proto, ಠscope = self._scope;
def.name = nil;
self.ಠattr_accessor("name");
def.ಠinitialize = function(name) {
var self = this;
return self.name = name;
};
return (def['ಠadmin?'] = function() {
var self = this;
return self.name['ಠ==']("Admin");
}, nil);
})(self, null);
user = ಠscope.User.ಠnew("Bob");
self.ಠputs(user);
return self.ಠputs(user['ಠadmin?']());
})(Opal);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment