i need to set an instance variable in my object once and make sure this
variable is not changed afterwards. i tried the code below which i
to fail with a TypeError but it happily outputs ‘2’. i kind of
why it succeeds, i think it just creates another @id when i call id=()
method, but is there a way to do what i want to do?
@id = id
c = C.new(1)
c.id = 2