Class: Arxutils::TransactState
- Inherits:
-
Object
- Object
- Arxutils::TransactState
- Defined in:
- lib/arxutils/transactstate.rb
Overview
簡易的なトランザクション処理
Instance Attribute Summary collapse
-
#ids ⇒ Object
readonly
対象ID群.
-
#state ⇒ Object
状態.
Instance Method Summary collapse
-
#add(xid) ⇒ Object
:TRACE状態の時のみ対象IDとして追加.
-
#clear ⇒ Object
対象ID群をクリア.
-
#initialize ⇒ TransactState
constructor
初期化.
-
#need? ⇒ Boolean
処理の必要性の確認.
Constructor Details
#initialize ⇒ TransactState
初期化
10 11 12 13 14 15 |
# File 'lib/arxutils/transactstate.rb', line 10 def initialize # 対象ID群 @ids = [] # 状態 @state = :NONE end |
Instance Attribute Details
#ids ⇒ Object (readonly)
対象ID群
5 6 7 |
# File 'lib/arxutils/transactstate.rb', line 5 def ids @ids end |
#state ⇒ Object
状態
7 8 9 |
# File 'lib/arxutils/transactstate.rb', line 7 def state @state end |
Instance Method Details
#add(xid) ⇒ Object
:TRACE状態の時のみ対象IDとして追加
18 19 20 |
# File 'lib/arxutils/transactstate.rb', line 18 def add( xid ) @ids << xid if @state == :TRACE end |
#clear ⇒ Object
対象ID群をクリア
23 24 25 |
# File 'lib/arxutils/transactstate.rb', line 23 def clear @ids = [] end |
#need? ⇒ Boolean
処理の必要性の確認
28 29 30 |
# File 'lib/arxutils/transactstate.rb', line 28 def need? @ids.size > 0 end |