Possible Duplicate:
How Do I Access This Variable?
Lets say I have the code:
class Player
def getsaves
print "Saves: "
saves = gets
end
def initialize(saves, era, holds, strikeouts, whip)
end
end
I want to be able to access the saves variable in getsaves in the initialize method say:
j = Player.new(getsaves_saves_variable, 30, 30, 30, 30)
define the attributes:
then in getsaves you can do: