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)



73
74
75
# File 'lib/al_controller.rb', line 73

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

.[]=(k, v) ⇒ Object

変数の保存

Parameters:

  • k (Symbol)

    キー

  • v (Object)



63
64
65
# File 'lib/al_controller.rb', line 63

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

.delete(k) ⇒ Object

変数の消去

Parameters:

  • k (Symbol)

    キー



82
83
84
# File 'lib/al_controller.rb', line 82

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

.delete_allObject

変数の全消去



89
90
91
92
93
94
95
96
97
# File 'lib/al_controller.rb', line 89

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