Redefined Accessors
Posted by matijs 10/12/2010 at 09h29
If you’re going to do this:
def foo= f
@foo = f + " bar"
endThen don’t first do this:
attr_accessor :fooBut instead do this:
attr_reader :fooThat way, there won’t be “method redefined” warnings all over the place.
Let’s make this more general: Before you release your gem, make sure it runs without warnings. They should stick out like a sore thumb when you run your tests, anyway.
Thanks.
