Class: DatabaseConsistency::Report
- Inherits:
-
Object
- Object
- DatabaseConsistency::Report
- Defined in:
- lib/database_consistency/report.rb
Overview
This class outputs the report result
Instance Attribute Summary collapse
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Report
constructor
A new instance of Report.
- #result(status, message) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Report
Returns a new instance of Report.
6 7 8 |
# File 'lib/database_consistency/report.rb', line 6 def initialize(opts = {}) @opts = opts end |
Instance Attribute Details
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
4 5 6 |
# File 'lib/database_consistency/report.rb', line 4 def opts @opts end |
Instance Method Details
#result(status, message) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/database_consistency/report.rb', line 10 def result(status, ) { status: status, message: }.tap { |hash| hash[:opts] = opts unless opts.empty? } end |