Modules cant have instance variables right?


#1



module Action
def jump
@distance = rand(4) + 2
puts "I jumped forward #{@distance} feet!"
end
end

modules cant have instance variables it can only have constants, so how come we see one in the jump method.

Replace this line with your code.


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.