Class CloudKit::FlashSession

  1. lib/cloudkit/flash_session.rb
Parent: Object

FlashSessions are hashes that forget their contents after the first access. Useful for session-based messaging.

Methods

public class

  1. new

public instance

  1. []
  2. []=

Public class methods

new ()
[show source]
   # File lib/cloudkit/flash_session.rb, line 6
6:     def initialize
7:       @values = {}
8:     end

Public instance methods

[] (k)

Access a value, then forget it.

[show source]
    # File lib/cloudkit/flash_session.rb, line 16
16:     def [](k)
17:       @values.delete(k)
18:     end
[]= (k, v)

Set the value for a key.

[show source]
    # File lib/cloudkit/flash_session.rb, line 11
11:     def []=(k, v)
12:       @values[k] = v
13:     end