Created
February 1, 2013 19:45
-
-
Save anonymous/4693598 to your computer and use it in GitHub Desktop.
Custom initializers in macruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
framework 'foundation' | |
class Node < NSXMLNode | |
def initialize(name) | |
initWithName(name) | |
self | |
end | |
end | |
node = Node.new('root') | |
p node.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment