Skip to content

Instantly share code, notes, and snippets.

Created July 9, 2016 23:26
Show Gist options
  • Save anonymous/3679e2abf0b4724225cc38126be5a7d2 to your computer and use it in GitHub Desktop.
Save anonymous/3679e2abf0b4724225cc38126be5a7d2 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