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.
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/ruby_mvc/controllers/app_controller.rb', line 62 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.
56 57 58 |
# File 'lib/ruby_mvc/controllers/app_controller.rb', line 56 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.
79 80 |
# File 'lib/ruby_mvc/controllers/app_controller.rb', line 79 def run end |