Class: Alexandria::UI::SearchThreadCounter
- Inherits:
-
Monitor
- Object
- Monitor
- Alexandria::UI::SearchThreadCounter
- Defined in:
- lib/alexandria/ui/acquire_dialog.rb
Overview
assists in turning on progress bar when searching and turning it off when all search threads have completed…
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
Instance Method Summary collapse
- #end_search ⇒ Object
-
#initialize ⇒ SearchThreadCounter
constructor
A new instance of SearchThreadCounter.
- #new_search ⇒ Object
Constructor Details
#initialize ⇒ SearchThreadCounter
Returns a new instance of SearchThreadCounter.
23 24 25 26 |
# File 'lib/alexandria/ui/acquire_dialog.rb', line 23 def initialize @count = 0 super end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
21 22 23 |
# File 'lib/alexandria/ui/acquire_dialog.rb', line 21 def count @count end |
Instance Method Details
#end_search ⇒ Object
34 35 36 37 38 |
# File 'lib/alexandria/ui/acquire_dialog.rb', line 34 def end_search synchronize do @count -= 1 unless @count.zero? end end |
#new_search ⇒ Object
28 29 30 31 32 |
# File 'lib/alexandria/ui/acquire_dialog.rb', line 28 def new_search synchronize do @count += 1 end end |