module HelloWorld
   def self.hello(persons_name)
      if name == persons_name 
      elsif 
      	 name ="World"
      end
         "Hello, #{name}!"
   end
end

# b=true
# puts "blah" if a=b
module HelloWorld
   def self.hello(persons_name)
      if name == persons_name 
      else 
      	 name ="World"
         "Hello, #{name}!"
      end
   end
end
class HelloWorld
   def self.hello(name = persons_name)
       "Hello, World!"
   end
end

“Hello, World!” via Exercism: A Rubyist Greeting

Category: NotesProgrammierung
247 views