Class: TestProf::Autopilot::FactoryDefault::Report
- Inherits:
-
Object
- Object
- TestProf::Autopilot::FactoryDefault::Report
- Extended by:
- ReportBuilder
- Defined in:
- lib/test_prof/autopilot/factory_default/report.rb
Constant Summary collapse
- ARTIFACT_FILE =
"factory_default_prof_report.json"
Constants included from ReportBuilder
ReportBuilder::ARTIFACT_MISSING_HINT
Instance Attribute Summary collapse
-
#raw_report ⇒ Object
readonly
Returns the value of attribute raw_report.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #factories ⇒ Object
-
#initialize(raw_report) ⇒ Report
constructor
A new instance of Report.
- #merge(other) ⇒ Object
- #result ⇒ Object
Methods included from ReportBuilder
Constructor Details
#initialize(raw_report) ⇒ Report
Returns a new instance of Report.
18 19 20 21 |
# File 'lib/test_prof/autopilot/factory_default/report.rb', line 18 def initialize(raw_report) @type = :factory_default_prof @raw_report = raw_report end |
Instance Attribute Details
#raw_report ⇒ Object (readonly)
Returns the value of attribute raw_report.
16 17 18 |
# File 'lib/test_prof/autopilot/factory_default/report.rb', line 16 def raw_report @raw_report end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
16 17 18 |
# File 'lib/test_prof/autopilot/factory_default/report.rb', line 16 def type @type end |
Instance Method Details
#factories ⇒ Object
27 28 29 |
# File 'lib/test_prof/autopilot/factory_default/report.rb', line 27 def factories result.dup end |
#merge(other) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/test_prof/autopilot/factory_default/report.rb', line 31 def merge(other) report = result.dup other.result.each do |name, stats| if result.key?(name) report[name][:count] += stats[:count] report[name][:time] += stats[:time] else report[name] = stats end end Report.new(report) end |
#result ⇒ Object
23 24 25 |
# File 'lib/test_prof/autopilot/factory_default/report.rb', line 23 def result @result ||= raw_report.tap { |r| r.transform_values! { |v| v.transform_keys!(&:to_sym) } } end |