Skip to content

Instantly share code, notes, and snippets.

@nelantone
Created July 22, 2016 10:56
Show Gist options
  • Select an option

  • Save nelantone/1abeafda27f5b832707d62fa32d1fe7d to your computer and use it in GitHub Desktop.

Select an option

Save nelantone/1abeafda27f5b832707d62fa32d1fe7d to your computer and use it in GitHub Desktop.
3.1
puts 'Hi there!'
p 'Hi now also returning this string not only printing'
def say_hi
p 'I say hi to you!'
end
say_hi
def say_hi(nickname)
p 'Hello' + ' ' + nickname + ' nice nickname!'
end
say_hi('humpalumpa')
new_nickname = "hodooor"
say_hi(new_nickname)
def greeting_and_get_name
puts "Please enter your name"
name = gets.chomp
puts "Hello" + " " + name
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment