Created
December 2, 2008 02:53
-
-
Save newzealandpaul/30957 to your computer and use it in GitHub Desktop.
Hello World from http://www.oreillynet.com/ruby/blog/2005/12/hello_world.html
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
# Copied/Pasted from http://www.oreillynet.com/ruby/blog/2005/12/hello_world.html | |
# The Greeter class | |
class Greeter | |
def initialize(name) | |
@name = name.capitalize | |
end | |
def salute | |
puts "Hello #{@name}!" | |
end | |
end | |
# Create a new object | |
g = Greeter.new("world") | |
# Output "Hello World!" | |
g.salute |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment