Skip to content

Instantly share code, notes, and snippets.

@Phoenix23A
Created February 20, 2017 18:46
Show Gist options
  • Save Phoenix23A/7d3224df20198560621e7eaac5752c83 to your computer and use it in GitHub Desktop.
Save Phoenix23A/7d3224df20198560621e7eaac5752c83 to your computer and use it in GitHub Desktop.
p "Hello"
def greeting # here we say def to define a method and put the name of our method
p "hello" # here’s the code inside our method
end # and here we end or close our method
def greeting
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