S
Sergey U.
Freeze should prevent further modifications to 'var'...
mac-undrgrnd:~ yspro$ irb
ruby-1.9.2-p0 > var = 4
=> 4
ruby-1.9.2-p0 > var.frozen?
=> false
ruby-1.9.2-p0 > var.freeze
=> 4
ruby-1.9.2-p0 > var.frozen?
=> true
ruby-1.9.2-p0 > var = 5
=> 5
ruby-1.9.2-p0 > var.frozen?
=> false
ruby-1.9.2-p0 >
What's wrong?
mac-undrgrnd:~ yspro$ irb
ruby-1.9.2-p0 > var = 4
=> 4
ruby-1.9.2-p0 > var.frozen?
=> false
ruby-1.9.2-p0 > var.freeze
=> 4
ruby-1.9.2-p0 > var.frozen?
=> true
ruby-1.9.2-p0 > var = 5
=> 5
ruby-1.9.2-p0 > var.frozen?
=> false
ruby-1.9.2-p0 >
What's wrong?