Skip to content

Instantly share code, notes, and snippets.

@JakeAustwick
Created October 19, 2012 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JakeAustwick/3919643 to your computer and use it in GitHub Desktop.
Save JakeAustwick/3919643 to your computer and use it in GitHub Desktop.
(function() {
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass;
var jake = nil;
(function(__base, __super){
// line 1, (file), class Person
function Person() {};
Person = __klass(__base, __super, "Person", Person);
var Person_prototype = Person.prototype, __scope = Person._scope;
Person_prototype.$name = function() {
if (this.name == null) this.name = nil;
return this.name
},
Person_prototype['$name='] = function(val) {
return this.name = val
}, nil;
Person_prototype.$age = function() {
if (this.age == null) this.age = nil;
return this.age
},
Person_prototype['$age='] = function(val) {
return this.age = val
}, nil;
return Person_prototype.$home = function() {
if (this.home == null) this.home = nil;
return this.home
},
Person_prototype['$home='] = function(val) {
return this.home = val
}, nil;
})(self, null);
jake = __scope.Person.$new();
jake['$name=']("Jake");
jake['$age='](18);
jake['$home=']("UK");
self.$puts(jake.$name());
return self.$puts(jake.$age());
})();
class Person
attr_accessor :name
attr_accessor :age
attr_accessor :home
end
jake = Person.new
jake.name = "Jake"
jake.age = 18
jake.home = "UK"
puts jake.name
puts jake.age
# => Jake
# = > 18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment