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.
26 27 28 29 |
# File 'lib/alexandria/ui/acquire_dialog.rb', line 26 def initialize @count = 0 super end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
24 25 26 |
# File 'lib/alexandria/ui/acquire_dialog.rb', line 24 def count @count end |
Instance Method Details
#end_search ⇒ Object
37 38 39 40 41 |
# File 'lib/alexandria/ui/acquire_dialog.rb', line 37 def end_search synchronize do @count -= 1 unless @count.zero? end end |
#new_search ⇒ Object
31 32 33 34 35 |
# File 'lib/alexandria/ui/acquire_dialog.rb', line 31 def new_search synchronize do @count += 1 end end |