Class: CheckerJobs::Notifiers::EmailDefaultFormatter
- Inherits:
-
Object
- Object
- CheckerJobs::Notifiers::EmailDefaultFormatter
- Defined in:
- lib/checker_jobs/notifiers/email_default_formatter.rb
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(check, count, entries) ⇒ EmailDefaultFormatter
constructor
A new instance of EmailDefaultFormatter.
- #subject ⇒ Object
Constructor Details
#initialize(check, count, entries) ⇒ EmailDefaultFormatter
Returns a new instance of EmailDefaultFormatter.
2 3 4 5 6 |
# File 'lib/checker_jobs/notifiers/email_default_formatter.rb', line 2 def initialize(check, count, entries) @check = check @count = count @entries = entries end |
Instance Method Details
#body ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/checker_jobs/notifiers/email_default_formatter.rb', line 13 def body body = "<p>See more about this email on <a href='#{repository_url}'>Github</a>.</p>" if @entries body += "<p>Found %<class_name>s are: <ul>%<html_ids>s</ul></p>" % { class_name: @entries.first.class.name, html_ids: @entries.map { |entry| "<li>#{format_entry(entry)}</li>" }.join, } end body end |
#subject ⇒ Object
8 9 10 11 |
# File 'lib/checker_jobs/notifiers/email_default_formatter.rb', line 8 def subject name = @check.name.tr("_", " ").capitalize "#{name} checker found #{@count} element(s)" end |