Class: Alexandria::UI::SearchThreadCounter

Inherits:
Monitor
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeSearchThreadCounter

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

#countObject (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_searchObject



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_searchObject



31
32
33
34
35
# File 'lib/alexandria/ui/acquire_dialog.rb', line 31

def new_search
  synchronize do
    @count += 1
  end
end