Class: XCRes::AggregateAnalyzer
- Defined in:
- lib/xcres/analyzer/aggregate_analyzer.rb
Overview
A AggregateAnalyzer
runs multiple Analyzer
.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#analyzers ⇒ Array<Analyzer>
An array of
Analyzer
.
Attributes inherited from Analyzer
#exclude_file_patterns, #logger, #options, #sections, #target
Instance Method Summary collapse
-
#add_with_class(analyzer_class, options = {}) ⇒ Analyzer
Instantiate and add an analyzer by its class.
-
#analyze ⇒ Array<Hash>
Run all aggregated analyzers.
-
#initialize(project = nil, options = {}) ⇒ AggregateAnalyzer
constructor
A new instance of AggregateAnalyzer.
Methods inherited from Analyzer
#filter_exclusions, #find_file_refs_by_extname, #is_file_ref_included_in_application_target?, #new_section, #project, #resources_files
Methods included from FileHelper
Constructor Details
#initialize(project = nil, options = {}) ⇒ AggregateAnalyzer
Returns a new instance of AggregateAnalyzer.
13 14 15 16 |
# File 'lib/xcres/analyzer/aggregate_analyzer.rb', line 13 def initialize(project=nil, ={}) super self.analyzers = [] end |
Instance Attribute Details
#analyzers ⇒ Array<Analyzer>
Returns an array of Analyzer
.
11 12 13 |
# File 'lib/xcres/analyzer/aggregate_analyzer.rb', line 11 def analyzers @analyzers end |
Instance Method Details
#add_with_class(analyzer_class, options = {}) ⇒ Analyzer
Instantiate and add an analyzer by its class. All properties will be copied to the child analyzer.
38 39 40 41 42 43 44 |
# File 'lib/xcres/analyzer/aggregate_analyzer.rb', line 38 def add_with_class(analyzer_class, ={}) analyzer = analyzer_class.new(target, self..merge()) analyzer.exclude_file_patterns = exclude_file_patterns analyzer.logger = logger self.analyzers << analyzer analyzer end |
#analyze ⇒ Array<Hash>
Run all aggregated analyzers
23 24 25 |
# File 'lib/xcres/analyzer/aggregate_analyzer.rb', line 23 def analyze @sections = analyzers.map(&:analyze).flatten.compact end |