Class: AlController::AlControllerSession
- Inherits:
-
Object
- Object
- AlController::AlControllerSession
- Defined in:
- lib/al_controller.rb
Overview
コントローラローカルのセッション変数の動作定義
Instance Method Summary (collapse)
-
- (Object) [](k)
変数の取得.
-
- (Object) []=(k, v)
変数の保存.
-
- (Object) delete(k)
変数の消去.
-
- (Object) delete_all
変数の全消去.
Instance Method Details
- (Object) [](k)
変数の取得
44 45 46 |
# File 'lib/al_controller.rb', line 44 def []( k ) return AlSession["AL_#{AlController::CTRL}_#{k}"] end |
- (Object) []=(k, v)
変数の保存
34 35 36 |
# File 'lib/al_controller.rb', line 34 def []=( k, v ) AlSession["AL_#{AlController::CTRL}_#{k}"] = v end |
- (Object) delete(k)
変数の消去
53 54 55 |
# File 'lib/al_controller.rb', line 53 def delete( k ) AlSession::delete( "AL_#{AlController::CTRL}_#{k}" ) end |
- (Object) delete_all
変数の全消去
60 61 62 63 64 65 66 67 68 |
# File 'lib/al_controller.rb', line 60 def delete_all() AlSession::delete( "AL_STATE_#{CTRL}" ) prefix = "AL_#{AlController::CTRL}_" AlSession::keys().each do |k| if k.to_s.index( prefix ) == 0 AlSession::delete( k ) end end end |