From d1c689ce4d1092b2bdb74d383e5ddf51a9435002 Mon Sep 17 00:00:00 2001 From: solomongamid Date: Thu, 2 Jun 2016 17:25:03 +0200 Subject: [PATCH] new addition --- hello_world.rb | 20 ++++++++++++++------ sulimanruby/hello_world.rb | 15 +++++++++++++++ 2 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 sulimanruby/hello_world.rb diff --git a/hello_world.rb b/hello_world.rb index 81d8bfe..1742a6f 100644 --- a/hello_world.rb +++ b/hello_world.rb @@ -1,7 +1,15 @@ -class HelloWorld - def self.hello - # - # YOUR CODE GOES HERE - # + + + class HelloWorld + def initialize(name) + @name = name.capitalize end -end + def sayHi + puts "Hello #{@name}!" + end +end + +hello = HelloWorld.new("World") +hello.sayHi + + diff --git a/sulimanruby/hello_world.rb b/sulimanruby/hello_world.rb new file mode 100644 index 0000000..6aa98cf --- /dev/null +++ b/sulimanruby/hello_world.rb @@ -0,0 +1,15 @@ + + + class HelloWorld + def initialize(name) + @name = name.capitalize + end + def sayHi + puts "Hello #{@name}!" + end +end + +hello = HelloWorld.new("suliman") +hello.sayHi + +