Created
September 21, 2011 09:16
-
-
Save james/1231642 to your computer and use it in GitHub Desktop.
attr_accessor parsed as a method variable when setting with a get
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Base | |
attr_accessor :configuration | |
def initialize(configuration) | |
@configuration = configuration | |
end | |
def do_a_thing | |
configuration = configuration + 1 | |
end | |
end | |
Base.new(2).do_a_thing #=> NoMethodError: undefined method `+' for nil:NilClass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment