K
Kev Jackson
given:
test.rb :
require 'b'
b = B.new
lib/base.rb:
module A
class Base
end
end
lib/b.rb:
module A
class B < Base
end
end
Why do I get
/lib/b.rb:2: uninitialized constant A::Base (NameError)
from test.rb:1:in `require'
from test.rb:1
?
This is a stripped down version of what I want to do (ie organize my
code into a module, but still keep classes in separate files, have a
base class and inherit).
It's probably something trivial, but at the moment I'm stuck - any help
would be (as always) greatly appreciated
Kev
test.rb :
require 'b'
b = B.new
lib/base.rb:
module A
class Base
end
end
lib/b.rb:
module A
class B < Base
end
end
Why do I get
/lib/b.rb:2: uninitialized constant A::Base (NameError)
from test.rb:1:in `require'
from test.rb:1
?
This is a stripped down version of what I want to do (ie organize my
code into a module, but still keep classes in separate files, have a
base class and inherit).
It's probably something trivial, but at the moment I'm stuck - any help
would be (as always) greatly appreciated
Kev