Class: RubyMVC::AppController
- Inherits:
-
Object
- Object
- RubyMVC::AppController
- Includes:
- LinkDispatcher
- Defined in:
- lib/ruby_mvc/controllers/app_controller.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
Instance Method Summary collapse
-
#initialize(app_file) ⇒ AppController
constructor
By convention, the application is configured using an app.yml file in the same directory as the application controller.
-
#run ⇒ Object
This method is a placeholder for the actual initialization to be performed by the Ruby application itself.
Methods included from LinkDispatcher
Constructor Details
#initialize(app_file) ⇒ AppController
By convention, the application is configured using an app.yml file in the same directory as the application controller.
60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/ruby_mvc/controllers/app_controller.rb', line 60 def initialize(app_file) @config_file = File.(File.join(File.dirname(app_file), "../app.yml")) if !File.exist? @config_file @shoes.alert("Unable to locate configuration file.\nFile '#{@config_file}' not found.") @shoes.exit end @config = YAML.load(File.new(@config_file)) setup run end |
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
54 55 56 |
# File 'lib/ruby_mvc/controllers/app_controller.rb', line 54 def app @app end |
Instance Method Details
#run ⇒ Object
This method is a placeholder for the actual initialization to be performed by the Ruby application itself. It is called automatically by the constructor of the application controller.
77 78 |
# File 'lib/ruby_mvc/controllers/app_controller.rb', line 77 def run end |