Created
December 1, 2011 01:24
-
-
Save stouset/1412552 to your computer and use it in GitHub Desktop.
autoload best practice
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
autoload :Bar, 'foo/bar' | |
autoload :Baz, 'foo/baz' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'foo' | |
class Foo::Bar | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'foo' | |
class Foo::Baz | |
autoload :Qux, 'foo/baz/qux' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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