Class: AlController::AlControllerSession

Inherits:
Object
  • Object
show all
Defined in:
lib/al_controller.rb

Overview

コントローラローカルのセッション変数の動作定義

Class Method Summary collapse

Class Method Details

.[](k) ⇒ Object

変数の取得

Parameters:

  • k (Symbol)

    キー

Returns:

  • (Object)



67
68
69
# File 'lib/al_controller.rb', line 67

def self.[]( k )
  return AlSession["AL_#{CTRL}_#{k}"]
end

.[]=(k, v) ⇒ Object

変数の保存

Parameters:

  • k (Symbol)

    キー

  • v (Object)



57
58
59
# File 'lib/al_controller.rb', line 57

def self.[]=( k, v )
  AlSession["AL_#{CTRL}_#{k}"] = v
end

.delete(k) ⇒ Object

変数の消去

Parameters:

  • k (Symbol)

    キー



76
77
78
# File 'lib/al_controller.rb', line 76

def self.delete( k )
  AlSession::delete( "AL_#{CTRL}_#{k}" )
end

.delete_allObject

変数の全消去



83
84
85
86
87
88
89
90
91
# File 'lib/al_controller.rb', line 83

def self.delete_all()
  AlSession::delete( "AL_STATE_#{CTRL}" )
  prefix = "AL_#{CTRL}_"
  AlSession::keys().each do |k|
    if k.to_s.index( prefix ) == 0
      AlSession::delete( k )
    end
  end
end