Recently, I just wrote a simple game in Ruby. I needed the user to input a object's name which I created earlier.
When I give the variable name in the place of object's name, ruby thinks it is another string and outputs that
there is no such method(no method error)
How can I solve this?
class game
#somecode
def weapon_power
@power
end
end
object = game.new
x = gets #user inputs object
puts x.weapon_power