simplify ruby - using classes is overkill
This commit is contained in:
16
ruby.rb
16
ruby.rb
@@ -1,16 +1,2 @@
|
|||||||
#!/usr/bin/ruby
|
#!/usr/bin/ruby
|
||||||
|
puts "Hello World"
|
||||||
class Hello
|
|
||||||
|
|
||||||
def initialize
|
|
||||||
@message = "Hello World!"
|
|
||||||
end
|
|
||||||
|
|
||||||
def say_hi
|
|
||||||
puts @message
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
h = Hello.new
|
|
||||||
h.say_hi
|
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/ruby
|
|
||||||
puts "Hello World"
|
|
||||||
Reference in New Issue
Block a user