I'm having trouble accessing a module constant in a nested module. Here's the code:
outer.rb
require 'inner.rb'
module Outer
BASE_DIR = "cache/"
end
inner.rb
module Outer
module Inner
puts BASE_DIR
end
end
If I run the code in inner.rb I get the following error:
<module:Inner>': uninitialized constant Outer::Inner::BASE_DIR (NameError)
I thought that since BASE_DIR is declared in the outer module is should also be accessible in the inner module and it does not seem to be the case.