Skip to content

Instantly share code, notes, and snippets.

@stouset
Created December 1, 2011 01:24
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stouset/1412552 to your computer and use it in GitHub Desktop.
Save stouset/1412552 to your computer and use it in GitHub Desktop.
autoload best practice
class Foo
autoload :Bar, 'foo/bar'
autoload :Baz, 'foo/baz'
end
require 'foo'
class Foo::Bar
end
require 'foo'
class Foo::Baz
autoload :Qux, 'foo/baz/qux'
end
require 'foo/bar'
class Foo::Baz::Qux
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment