Hello, I am new to using Ruby so I apologize if my question seems fairly
easy.
I am trying to loop a method back the the beginning of the method for
example:
def start
#code
end
gets.chomp
def other_start
puts “please type yes”
choice = gets.chomp!
end
end
start
#I want to loop the method “other_start” to the method “start” if the
user types “yes”
Now I know how to do loops but I don’t know how I would loop a method to
another method, would it be the same thing as just looping if the input
equals the answer I’m looking for? Such as:
other_start.each do |start|
If you could help me out with the syntax and explain what it’s doing,
that
would be greatly appreciated. Thank you ahead of time!