Class definition OK?


#1

Something’s not working, and I just want to make sure that my class is
not to blame and that I’ve got how it works straight in my head:

The attr_reader parts make those :something (hash values, i think)
accessible as @class.something attributes outside of the class. So, once
I find the right session in the controller, I can access those values as
@session.something. Right?

For some reason I’m just getting zero for @question_total and errors for
@point_total

class Test_session

attr_reader :point_total
attr_reader :question_total

def initialize
@point_total = 0
@question_total = 0
end

def keep_score(points)
@question_total += @question_total
@point_total = @point_total + points
end

end