Class: XCKnife::EventsAnalyzer
- Inherits:
-
Object
- Object
- XCKnife::EventsAnalyzer
- Includes:
- JsonStreamParserHelper
- Defined in:
- lib/xcknife/events_analyzer.rb
Instance Attribute Summary collapse
-
#target_class_map ⇒ Object
readonly
Returns the value of attribute target_class_map.
-
#total_tests ⇒ Object
readonly
Returns the value of attribute total_tests.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(events, relevant_partitions) ⇒ EventsAnalyzer
constructor
A new instance of EventsAnalyzer.
- #test_class?(target, clazz) ⇒ Boolean
- #test_target?(target) ⇒ Boolean
Methods included from JsonStreamParserHelper
#each_test_event, #normalize_result
Constructor Details
#initialize(events, relevant_partitions) ⇒ EventsAnalyzer
Returns a new instance of EventsAnalyzer.
17 18 19 20 21 |
# File 'lib/xcknife/events_analyzer.rb', line 17 def initialize(events, relevant_partitions) @total_tests = 0 @relevant_partitions = relevant_partitions @target_class_map = analyze_events(events) end |
Instance Attribute Details
#target_class_map ⇒ Object (readonly)
Returns the value of attribute target_class_map.
9 10 11 |
# File 'lib/xcknife/events_analyzer.rb', line 9 def target_class_map @target_class_map end |
#total_tests ⇒ Object (readonly)
Returns the value of attribute total_tests.
9 10 11 |
# File 'lib/xcknife/events_analyzer.rb', line 9 def total_tests @total_tests end |
Class Method Details
.for(events, relevant_partitions) ⇒ Object
11 12 13 14 15 |
# File 'lib/xcknife/events_analyzer.rb', line 11 def self.for(events, relevant_partitions) return NullEventsAnalyzer.new if events.nil? new(events, relevant_partitions) end |
Instance Method Details
#test_class?(target, clazz) ⇒ Boolean
27 28 29 |
# File 'lib/xcknife/events_analyzer.rb', line 27 def test_class?(target, clazz) test_target?(target) and target_class_map[target].include?(clazz) end |
#test_target?(target) ⇒ Boolean
23 24 25 |
# File 'lib/xcknife/events_analyzer.rb', line 23 def test_target?(target) target_class_map.key?(target) end |