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.
297 298 299 300 301 |
# File 'lib/action_controller/test_process.rb', line 297 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.
295 296 297 |
# File 'lib/action_controller/test_process.rb', line 295 def session_id @session_id end |
Instance Method Details
#[](key) ⇒ Object
307 308 309 |
# File 'lib/action_controller/test_process.rb', line 307 def [](key) data[key.to_s] end |
#[]=(key, value) ⇒ Object
311 312 313 |
# File 'lib/action_controller/test_process.rb', line 311 def []=(key, value) data[key.to_s] = value end |
#close ⇒ Object
323 324 325 326 |
# File 'lib/action_controller/test_process.rb', line 323 def close update delete end |
#data ⇒ Object
303 304 305 |
# File 'lib/action_controller/test_process.rb', line 303 def data @attributes ||= @saved_attributes || {} end |
#delete ⇒ Object
319 320 321 |
# File 'lib/action_controller/test_process.rb', line 319 def delete @attributes = nil end |
#update ⇒ Object
315 316 317 |
# File 'lib/action_controller/test_process.rb', line 315 def update @saved_attributes = @attributes end |