class UnitCircle
def prompt
puts "Enter a number: "
@number = gets
@number = @number.to_i
puts "Enter a trigonometric equation to perform on that number: "
@eqn = gets
end
end
uc = UnitCircle.new
uc.prompt
num = Math.send(uc.instance_eval {@eqn}, uc.instance_eval {@number})
当我尝试运行它时,
@number = 30
@eqn = sin
我得到一个无方法错误,为什么?