simonh <simonharrison / fastmail.co.uk> wrote:

> But it doesn't work. How do I get the value entered by the user into
> the method parameter?

def check_age
  print "Please enter your age: "
  age = gets.chomp.to_i
  eligible = 18..30

  if age < 18
    print "Sorry, too young."
  elsif eligible === age
    print "Have a great holiday!"
  else
    print "Input not understood."
    check_age # trying recursion here
  end
end

check_age


works fine
-- 
une bue