I have the following files:
file.rb
require_relative 'foo/bar'
baz = Foo::Stuff::Baz.new
# do stuff
foo/bar.rb
require_relative 'stuff/baz'
module Foo
class Bar
def initialize
# do stuff
end
end
end
foo/stuff/baz.rb
module Foo
module Stuff
class Baz < Bar
end
end
end
I get the following error:
`': uninitialized constant Foo::Stuff::Bar (NameError)
Is there something I'm doing wrong here? Is this even possible in Ruby? In case it matters, I'm only doing this because I need to inherit the initialize method specifically.