Class: DatabaseConsistency::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/database_consistency/report.rb

Overview

This class outputs the report result

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#optsObject (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, message)
  {
    status:  status,
    message: message
  }.tap { |hash| hash[:opts] = opts unless opts.empty? }
end