Class: SlowActions::Session
- Inherits:
-
Object
- Object
- SlowActions::Session
- Includes:
- Computable
- Defined in:
- lib/slow_actions/slow_actions_session.rb
Overview
Class to hold and #LogEntry objects that are associated with this individual Session ID
Instance Attribute Summary collapse
-
#log_entries ⇒ Object
readonly
All the #LogEntry objects this #Session holds.
-
#name ⇒ Object
readonly
The session_id.
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_entry(la) ⇒ Object
Add a #LogEntry to this #Session.
-
#initialize(name) ⇒ Session
constructor
Create a new session name: the session_id.
Methods included from Computable
Constructor Details
#initialize(name) ⇒ Session
Create a new session
name: the session_id
9 10 11 12 |
# File 'lib/slow_actions/slow_actions_session.rb', line 9 def initialize(name) @name = name @log_entries = [] end |
Instance Attribute Details
#log_entries ⇒ Object (readonly)
All the #LogEntry objects this #Session holds
22 23 24 |
# File 'lib/slow_actions/slow_actions_session.rb', line 22 def log_entries @log_entries end |
#name ⇒ Object (readonly)
The session_id
14 15 16 |
# File 'lib/slow_actions/slow_actions_session.rb', line 14 def name @name end |
Instance Method Details
#add_entry(la) ⇒ Object
Add a #LogEntry to this #Session
17 18 19 20 |
# File 'lib/slow_actions/slow_actions_session.rb', line 17 def add_entry(la) @log_entries << la la.session = self end |