class Player
def getsaves
print "Saves: "
saves = gets
end
def initialize(saves, era, holds, strikeouts, whip)
end
end
我有上面的代码......可以说我然后写。
j = Player.new(30, 30, 30, 30, 30)
当我在类范围之外时,我想访问 saves 变量,getsaves
我该怎么做?:
puts saves variable that is inside getsaves