Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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