Add name and code

This commit is contained in:
Iqlaas
2018-10-03 14:29:46 +08:00
parent 735adcf84a
commit 95b5b958c7
2 changed files with 16 additions and 0 deletions

11
code/rubyhelloworld.rb Normal file
View File

@@ -0,0 +1,11 @@
class HelloWorld
def initialize(name)
@name = name.capitalize
end
def say_hi
puts "Hello #{@name}!"
end
end
hello = HelloWorld.new("World")
hello.say_hi