Created
July 9, 2016 23:26
-
-
Save anonymous/3679e2abf0b4724225cc38126be5a7d2 to your computer and use it in GitHub Desktop.
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
##### file1.rb | |
require_relative "file2" | |
class Foo | |
def initialize | |
# I don't want to put any code from file2 here | |
end | |
end | |
##### file2.rb | |
class Foo | |
@myarr = [] | |
def bar | |
@myarr.push Random.rand | |
end | |
end | |
############################ | |
ERROR: @myarr is nil inside Foo.bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment