Class: Controller
- Inherits:
-
Object
- Object
- Controller
- Defined in:
- lib/shot_mvc/controller.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
Application instance to which the controller belongs.
-
#view_private ⇒ Object
An array of actions which can not be called from a view.
Instance Method Summary collapse
-
#add_private_action(action) ⇒ Object
Adds an action to the list of private, non-view-callable actions.
-
#get(type, name) ⇒ Object
Utilize a Loader.
-
#initialize(app) ⇒ Controller
constructor
Instantiate the controller and keep track of the passed ApplicationInstance.
Constructor Details
#initialize(app) ⇒ Controller
Instantiate the controller and keep track of the passed ApplicationInstance
19 20 21 22 |
# File 'lib/shot_mvc/controller.rb', line 19 def initialize(app) @view_private = [] @app = app end |
Instance Attribute Details
#app ⇒ Object
Application instance to which the controller belongs
12 13 14 |
# File 'lib/shot_mvc/controller.rb', line 12 def app @app end |
#view_private ⇒ Object
An array of actions which can not be called from a view
15 16 17 |
# File 'lib/shot_mvc/controller.rb', line 15 def view_private @view_private end |
Instance Method Details
#add_private_action(action) ⇒ Object
Adds an action to the list of private, non-view-callable actions
Attributes
-
action
- String name of a controller method
30 31 32 |
# File 'lib/shot_mvc/controller.rb', line 30 def add_private_action(action) view_private.push action end |
#get(type, name) ⇒ Object
Utilize a Loader.
- Note
-
This is a convenient access method for ApplicationInstance#get
38 39 40 |
# File 'lib/shot_mvc/controller.rb', line 38 def get(type, name) @app.get type, name end |