Accessing variables from included files in Ruby
- by nickf
How do you access variables which are defined in an included file?
# inc.rb
foo = "bar";
# main.rb
require 'inc.rb'
puts foo
# NameError: undefined local variable or method `foo' for main:Object