V
Ves Pasian
For the life of me I can figure out why the setter below returns "v" and
not nil
class A
def initialize(id)
@id = id
end
def id
@id
end
def id=(v)
nil
end
end
a = A.new(1)
a.id = 2
=> 2
Any idea?
TIA,
ves
not nil
class A
def initialize(id)
@id = id
end
def id
@id
end
def id=(v)
nil
end
end
a = A.new(1)
a.id = 2
=> 2
Any idea?
TIA,
ves