Skip to content

Instantly share code, notes, and snippets.

/foo.rb Secret

Created July 9, 2016 23:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/81c6dd7b662bc9666262848fd3206ed7 to your computer and use it in GitHub Desktop.
Save anonymous/81c6dd7b662bc9666262848fd3206ed7 to your computer and use it in GitHub Desktop.
##### 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