J
Joe
I'm confused about attr_writer. I thought it worked like this:
class Foo
attr_writer :bar
def do_stuff
puts @bar
end
end
foo = Foo.new
foo.bar = 'baz'
foo.do_stuff # gives nil error
Can somebody enlighten me?
Thanks,
Joe
class Foo
attr_writer :bar
def do_stuff
puts @bar
end
end
foo = Foo.new
foo.bar = 'baz'
foo.do_stuff # gives nil error
Can somebody enlighten me?
Thanks,
Joe