testy.rb:
module Testy
VERSION = '0.1.0'
end
grumpy.rb:
module Testy
class Grumpy
def initialize
puts "Grrr."
end
end
end
test.rb:
autoload("Testy", "/home/colin/ruby/code/testy.rb")
autoload("Grumpy", "/home/colin/ruby/code/grumpy.rb")
x = Testy
x = Testy::Grumpy
$ruby test.rb
test.rb:4: uninitialized constant Grumpy (NameError)
Why?
--
Colin Steele
colin / webg2.com / www.colinsteele.org / www.rubycookbook.org
From "The Hacker's Dictionary":
skulker: n. Syn. {prowler}.