Moved from hello-ruby repo to here
This commit is contained in:
parent
d15d79ad27
commit
b7e1f4d9ba
2 changed files with 18 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
||||||
# Hello (World) Learning
|
# Hello Ruby
|
||||||
|
|
||||||
A place for me to play around with some basic example apps, most commonly "Hello World"'s and "TODO" examples.
|
```bash
|
||||||
|
ruby helloworld-ruby.rb
|
||||||
**Each language/framework is broken down by branch.**
|
```
|
||||||
|
Prints: `Hello World`
|
||||||
|
|
||||||
|
|
13
hello-world.rb
Normal file
13
hello-world.rb
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# https://stackoverflow.com/questions/705729/how-do-i-create-a-ruby-hello-world#705754
|
||||||
|
|
||||||
|
class HelloWorld
|
||||||
|
def initialize(name)
|
||||||
|
@name = name.capitalize
|
||||||
|
end
|
||||||
|
def sayHi
|
||||||
|
puts "Hello #{@name}!"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
hello = HelloWorld.new("World")
|
||||||
|
hello.sayHi
|
Loading…
Add table
Reference in a new issue