Class: Arxutils::TransactStateGroup
- Inherits:
-
Object
- Object
- Arxutils::TransactStateGroup
- Defined in:
- lib/arxutils/transactstate.rb
Overview
複数の簡易的なトランザクション処理
Instance Method Summary collapse
-
#initialize(*names) ⇒ TransactStateGroup
constructor
初期化.
-
#method_missing(name, lang = nil) ⇒ Object
指定名の状態を返す.
-
#need? ⇒ Boolean
処理の必要性の確認.
-
#reset ⇒ Object
状態を:NONEに一括設定.
-
#set_all_inst_state ⇒ Object
状態の一括設定.
-
#trace ⇒ Object
状態を:TRACEに一括設定.
Constructor Details
#initialize(*names) ⇒ TransactStateGroup
初期化
37 38 39 40 41 |
# File 'lib/arxutils/transactstate.rb', line 37 def initialize( *names ) @state = :NONE @inst = {} names.map{|x| @inst[x] = TransactState.new } end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, lang = nil) ⇒ Object
指定名の状態を返す
66 67 68 |
# File 'lib/arxutils/transactstate.rb', line 66 def method_missing(name , lang = nil) @inst[name] end |
Instance Method Details
#need? ⇒ Boolean
処理の必要性の確認
44 45 46 |
# File 'lib/arxutils/transactstate.rb', line 44 def need? @state != :NONE end |
#reset ⇒ Object
状態を:NONEに一括設定
60 61 62 63 |
# File 'lib/arxutils/transactstate.rb', line 60 def reset @state = :NONE set_all_inst_state end |
#set_all_inst_state ⇒ Object
状態の一括設定
49 50 51 |
# File 'lib/arxutils/transactstate.rb', line 49 def set_all_inst_state @inst.map{|x| x[1].state = @state } end |
#trace ⇒ Object
状態を:TRACEに一括設定
54 55 56 57 |
# File 'lib/arxutils/transactstate.rb', line 54 def trace @state = :TRACE set_all_inst_state end |