Class: Igniter::Extensions::Contracts::Debug::Report
- Inherits:
-
Object
- Object
- Igniter::Extensions::Contracts::Debug::Report
- Defined in:
- lib/igniter/extensions/contracts/debug/report.rb
Instance Attribute Summary collapse
-
#compilation_report ⇒ Object
readonly
Returns the value of attribute compilation_report.
-
#diagnostics_report ⇒ Object
readonly
Returns the value of attribute diagnostics_report.
-
#execution_result ⇒ Object
readonly
Returns the value of attribute execution_result.
-
#profile_snapshot ⇒ Object
readonly
Returns the value of attribute profile_snapshot.
-
#provenance_summary ⇒ Object
readonly
Returns the value of attribute provenance_summary.
Instance Method Summary collapse
-
#initialize(profile_snapshot:, compilation_report: nil, execution_result: nil, diagnostics_report: nil, provenance_summary: nil) ⇒ Report
constructor
A new instance of Report.
- #invalid? ⇒ Boolean
- #ok? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(profile_snapshot:, compilation_report: nil, execution_result: nil, diagnostics_report: nil, provenance_summary: nil) ⇒ Report
Returns a new instance of Report.
16 17 18 19 20 21 22 23 24 |
# File 'lib/igniter/extensions/contracts/debug/report.rb', line 16 def initialize(profile_snapshot:, compilation_report: nil, execution_result: nil, diagnostics_report: nil, provenance_summary: nil) @profile_snapshot = profile_snapshot @compilation_report = compilation_report @execution_result = execution_result @diagnostics_report = diagnostics_report @provenance_summary = provenance_summary freeze end |
Instance Attribute Details
#compilation_report ⇒ Object (readonly)
Returns the value of attribute compilation_report.
10 11 12 |
# File 'lib/igniter/extensions/contracts/debug/report.rb', line 10 def compilation_report @compilation_report end |
#diagnostics_report ⇒ Object (readonly)
Returns the value of attribute diagnostics_report.
10 11 12 |
# File 'lib/igniter/extensions/contracts/debug/report.rb', line 10 def diagnostics_report @diagnostics_report end |
#execution_result ⇒ Object (readonly)
Returns the value of attribute execution_result.
10 11 12 |
# File 'lib/igniter/extensions/contracts/debug/report.rb', line 10 def execution_result @execution_result end |
#profile_snapshot ⇒ Object (readonly)
Returns the value of attribute profile_snapshot.
10 11 12 |
# File 'lib/igniter/extensions/contracts/debug/report.rb', line 10 def profile_snapshot @profile_snapshot end |
#provenance_summary ⇒ Object (readonly)
Returns the value of attribute provenance_summary.
10 11 12 |
# File 'lib/igniter/extensions/contracts/debug/report.rb', line 10 def provenance_summary @provenance_summary end |
Instance Method Details
#invalid? ⇒ Boolean
30 31 32 |
# File 'lib/igniter/extensions/contracts/debug/report.rb', line 30 def invalid? !ok? end |
#ok? ⇒ Boolean
26 27 28 |
# File 'lib/igniter/extensions/contracts/debug/report.rb', line 26 def ok? compilation_report.nil? || compilation_report.ok? end |
#to_h ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/igniter/extensions/contracts/debug/report.rb', line 34 def to_h payload = { profile: profile_snapshot.to_h, ok: ok? } payload[:compilation] = compilation_report.to_h if compilation_report payload[:execution] = execution_result.to_h if execution_result payload[:diagnostics] = diagnostics_report.to_h if diagnostics_report payload[:provenance] = provenance_summary if provenance_summary payload end |