Skip to content

Instantly share code, notes, and snippets.

@ScorpIan555
Created October 17, 2016 01:17
Show Gist options
  • Select an option

  • Save ScorpIan555/eb32c9e7debce2651179903257b48b53 to your computer and use it in GitHub Desktop.

Select an option

Save ScorpIan555/eb32c9e7debce2651179903257b48b53 to your computer and use it in GitHub Desktop.
my_name = "Ian"
puts "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
greeting
def greeting(name)
p "hello" + " " + name
end
greeting("Ian")
greeting(my_name)
def greeting
puts "Please enter your name:"
name = gets.chomp
puts "Hello" + " " + name
end
greeting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment