Skip to content

Instantly share code, notes, and snippets.

@venkatd
Created September 14, 2012 20:32
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 venkatd/3724584 to your computer and use it in GitHub Desktop.
Save venkatd/3724584 to your computer and use it in GitHub Desktop.
Greeter = Opal.class('Greeter', {
'initialize': function(name) {
this.set_first_name(name);
},
'greet': function() {
this.puts('Hi, ' + this.first_name());
},
'first_name': function() {
return this._first_name;
},
'set_first_name': function(name) {
this._first_name = name;
}
});
class Greeter
def initialize(name)
self.first_name = name
end
def greet
puts "Hi, #{first_name}"
end
attr_accessor :first_name
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment