Class: AlControllerBase::AlControllerSession

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

Overview

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

Class Method Summary (collapse)

Class Method Details

+ (Object) [](k)

変数の取得

Parameters:

  • k (Symbol)

    キー

Returns:

  • (Object)



47
48
49
# File 'lib/al_controller.rb', line 47

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

+ (Object) []=(k, v)

変数の保存

Parameters:

  • k (Symbol)

    キー

  • v (Object)



37
38
39
# File 'lib/al_controller.rb', line 37

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

+ (Object) delete(k)

変数の消去

Parameters:

  • k (Symbol)

    キー



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

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

+ (Object) delete_all

変数の全消去



63
64
65
66
67
68
69
70
71
# File 'lib/al_controller.rb', line 63

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