Created
December 14, 2011 02:27
-
-
Save jakeonrails/1474972 to your computer and use it in GitHub Desktop.
Loading a class inside a module within Rails 3.0
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
# within app/importer/api.rb | |
module Importer | |
class API | |
# class body here | |
end | |
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
# this way works for some reason | |
# inside app/importer/api.rb | |
class Importer::API | |
# class body here | |
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
/Users/jake/Code/experimental/myproject/config/application.rb:10) | |
Loading development environment (Rails 3.0.10) | |
ruby-1.9.2-p290 :001 > Importer::API.new | |
LoadError: Expected /Users/jake/Code/experimental/myproject/app/importer/api.rb to define API |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment