Skip to content

Instantly share code, notes, and snippets.

@newzealandpaul
Created December 2, 2008 02:53
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 newzealandpaul/30957 to your computer and use it in GitHub Desktop.
Save newzealandpaul/30957 to your computer and use it in GitHub Desktop.
# 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