Skip to content

Instantly share code, notes, and snippets.

@DRot88
Created October 11, 2019 05:15
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 DRot88/7a25841431e39dc6601c792c99f735f9 to your computer and use it in GitHub Desktop.
Save DRot88/7a25841431e39dc6601c792c99f735f9 to your computer and use it in GitHub Desktop.
Testing
class HelloWorld:
def __init__(self, name):
self.name = name.capitalize()
def sayHi(self):
print "Hello " + self.name + "!"
hello = HelloWorld("world")
hello.sayHi()
Run `ruby hello_world.rb` to print Hello World
class HelloWorld
def initialize(name)
@name = name.capitalize
end
def sayHi
puts "Hello !"
end
end
hello = HelloWorld.new("World")
hello.sayHi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment