Class: ActionController::TestSession
- Defined in:
- lib/action_controller/test_process.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#session_id ⇒ Object
Returns the value of attribute session_id.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #close ⇒ Object
- #data ⇒ Object
- #delete ⇒ Object
-
#initialize(attributes = nil) ⇒ TestSession
constructor
A new instance of TestSession.
- #update ⇒ Object
Constructor Details
#initialize(attributes = nil) ⇒ TestSession
Returns a new instance of TestSession.
287 288 289 290 291 |
# File 'lib/action_controller/test_process.rb', line 287 def initialize(attributes = nil) @session_id = '' @attributes = attributes.nil? ? nil : attributes.stringify_keys @saved_attributes = nil end |
Instance Attribute Details
#session_id ⇒ Object
Returns the value of attribute session_id.
285 286 287 |
# File 'lib/action_controller/test_process.rb', line 285 def session_id @session_id end |
Instance Method Details
#[](key) ⇒ Object
297 298 299 |
# File 'lib/action_controller/test_process.rb', line 297 def [](key) data[key.to_s] end |
#[]=(key, value) ⇒ Object
301 302 303 |
# File 'lib/action_controller/test_process.rb', line 301 def []=(key, value) data[key.to_s] = value end |
#close ⇒ Object
313 314 315 316 |
# File 'lib/action_controller/test_process.rb', line 313 def close update delete end |
#data ⇒ Object
293 294 295 |
# File 'lib/action_controller/test_process.rb', line 293 def data @attributes ||= @saved_attributes || {} end |
#delete ⇒ Object
309 310 311 |
# File 'lib/action_controller/test_process.rb', line 309 def delete @attributes = nil end |
#update ⇒ Object
305 306 307 |
# File 'lib/action_controller/test_process.rb', line 305 def update @saved_attributes = @attributes end |