Created
September 21, 2012 08:58
-
-
Save stubotnik/3760461 to your computer and use it in GitHub Desktop.
uninitialized constant error
This file contains 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 MyProject < Padrino::Application | |
register Padrino::Rendering | |
register Padrino::Mailer | |
register Padrino::Helpers | |
MY_CONST = 123 | |
end |
This file contains 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
MyProject.controller do | |
get "/" do | |
p self.class # => MyProject | |
p self.class.constants # => [:DATA_ATTRIBUTES, ... <snip>..., :MY_CONST, ... <snip>... ] | |
p MyProject::MY_CONST # => 123 | |
p MY_CONST # => NameError - uninitialized constant MY_CONST | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment