Created
December 8, 2011 22:55
-
-
Save rosswarren/1449087 to your computer and use it in GitHub Desktop.
Object orientated Ruby Hello World
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
class HelloWorld | |
def initialize(name) | |
@name = name.capitalize | |
end | |
def sayHi | |
puts "Hello #{@name}!" | |
end | |
end | |
hello = HelloWorld.new("Github and Octopress!") | |
hello.sayHi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment