Class: I18n::Tasks::Scanners::ScannerMultiplexer
- Defined in:
- lib/i18n/tasks/scanners/scanner_multiplexer.rb
Overview
Note:
The scanners are run concurrently. A thread is spawned per each scanner.
Run multiple Scanners and merge their results.
Instance Method Summary collapse
-
#initialize(scanners:) ⇒ ScannerMultiplexer
constructor
A new instance of ScannerMultiplexer.
-
#keys ⇒ Array<Results::KeyOccurrences>
Collect the results of all the scanners.
Constructor Details
#initialize(scanners:) ⇒ ScannerMultiplexer
Returns a new instance of ScannerMultiplexer.
11 12 13 14 |
# File 'lib/i18n/tasks/scanners/scanner_multiplexer.rb', line 11 def initialize(scanners:) super() @scanners = scanners end |
Instance Method Details
#keys ⇒ Array<Results::KeyOccurrences>
Note:
The scanners are run concurrently. A thread is spawned per each scanner.
Collect the results of all the scanners. Occurrences of a key from multiple scanners are merged.
20 21 22 |
# File 'lib/i18n/tasks/scanners/scanner_multiplexer.rb', line 20 def keys Results::KeyOccurrences.merge_keys collect_results.flatten(1) end |