Class: SimpleServerMonitoring::Reporter

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_server_monitoring/reporter.rb

Defined Under Namespace

Classes: Report

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Reporter

Returns a new instance of Reporter.



9
10
11
12
# File 'lib/simple_server_monitoring/reporter.rb', line 9

def initialize(options = {})
  @to, @processes_file, @from = options.values_at(:to, :processes_file, :from)
  @report = build_report
end

Instance Attribute Details

#reportObject (readonly)

Returns the value of attribute report.



7
8
9
# File 'lib/simple_server_monitoring/reporter.rb', line 7

def report
  @report
end

Instance Method Details

#send_report_emailObject



14
15
16
# File 'lib/simple_server_monitoring/reporter.rb', line 14

def send_report_email
  send_email @to, subject: @report.subject, body: @report.body, content_type: "text/html", from: @from
end