class HighLowGame
attr_accessor :randno, :guess
def generateRandomNumber
randno = rand(99)
return randno
end
def getUserInput
puts "Enter your guess"
guess = gets.chomp.to_i
return guess
end
def getResult(getUserInput())
if guess < randno
puts "#{guess } is lower than Magic Number"
elsif guess > randno
puts "#{guess} is higher than Magic Number"
else guess == randno
puts "You are right!"
end
end
end
suresh = HighLowGame.new
suresh.getUserInput
suresh.getResult(getUserInput())
Is it possible to pass method to methods?
I tried googling most of it is passing block to methods.