Class: Arxutils::TransactStateGroup
- Inherits:
-
Object
- Object
- Arxutils::TransactStateGroup
show all
- Defined in:
- lib/arxutils/transactstate.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of TransactStateGroup.
25
26
27
28
29
|
# File 'lib/arxutils/transactstate.rb', line 25
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
49
50
51
|
# File 'lib/arxutils/transactstate.rb', line 49
def method_missing(name , lang = nil)
@inst[name]
end
|
Instance Method Details
#need? ⇒ Boolean
31
32
33
|
# File 'lib/arxutils/transactstate.rb', line 31
def need?
@state != :NONE
end
|
#reset ⇒ Object
44
45
46
47
|
# File 'lib/arxutils/transactstate.rb', line 44
def reset
@state = :NONE
set_all_inst_state
end
|
#set_all_inst_state ⇒ Object
35
36
37
|
# File 'lib/arxutils/transactstate.rb', line 35
def set_all_inst_state
@inst.map{|x| x[1].state = @state }
end
|
#trace ⇒ Object
39
40
41
42
|
# File 'lib/arxutils/transactstate.rb', line 39
def trace
@state = :TRACE
set_all_inst_state
end
|