Class: SlowActions::Controller
- Inherits:
-
Object
- Object
- SlowActions::Controller
- Includes:
- Computable
- Defined in:
- lib/slow_actions/slow_actions_controller.rb
Overview
Class to hold all #LogEntry objects that are associated with this #Controller.
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
All the #Actions under this #Controller.
-
#log_entries ⇒ Object
readonly
All the #LogEntry objects associated with this #Controller.
-
#name ⇒ Object
readonly
Name of the #Controller.
Attributes included from Computable
#db_avg, #db_cost, #db_max, #error_avg, #render_avg, #render_cost, #render_max, #total_avg, #total_cost, #total_max
Instance Method Summary collapse
-
#add_action(a) ⇒ Object
Add an #Action as a child of this #Controller.
-
#add_entry(la) ⇒ Object
Add a #LogEntry to this #Controller.
-
#initialize(name) ⇒ Controller
constructor
Create a new #Controller name: The name of the #Controller.
- #to_s ⇒ Object
Methods included from Computable
Constructor Details
#initialize(name) ⇒ Controller
Create a new #Controller
name: The name of the #Controller
9 10 11 12 13 |
# File 'lib/slow_actions/slow_actions_controller.rb', line 9 def initialize(name) @name = name @log_entries = [] @actions = [] end |
Instance Attribute Details
#actions ⇒ Object (readonly)
All the #Actions under this #Controller
30 31 32 |
# File 'lib/slow_actions/slow_actions_controller.rb', line 30 def actions @actions end |
#log_entries ⇒ Object (readonly)
All the #LogEntry objects associated with this #Controller
23 24 25 |
# File 'lib/slow_actions/slow_actions_controller.rb', line 23 def log_entries @log_entries end |
#name ⇒ Object (readonly)
Name of the #Controller
15 16 17 |
# File 'lib/slow_actions/slow_actions_controller.rb', line 15 def name @name end |
Instance Method Details
#add_action(a) ⇒ Object
Add an #Action as a child of this #Controller
26 27 28 |
# File 'lib/slow_actions/slow_actions_controller.rb', line 26 def add_action(a) @actions << a end |
#add_entry(la) ⇒ Object
Add a #LogEntry to this #Controller
18 19 20 21 |
# File 'lib/slow_actions/slow_actions_controller.rb', line 18 def add_entry(la) @log_entries << la la.controller = self end |
#to_s ⇒ Object
32 33 34 |
# File 'lib/slow_actions/slow_actions_controller.rb', line 32 def to_s @name end |