lib/mailpeek/email.rb in mailpeek-1.0.2 vs lib/mailpeek/email.rb in mailpeek-1.0.3
- old
+ new
@@ -1,9 +1,7 @@
# frozen_string_literal: true
-require 'mail/check_delivery_params'
-
module Mailpeek
# Public: Wrapper class for mail object
class Email
attr_reader(
:id, :position, :mail, :html, :text, :attachments, :to, :from, :subject,
@@ -19,24 +17,18 @@
@subject = mail.subject
@message_id = mail.message_id
@date = mail.date
@attachments = []
- if mail.multipart?
- parse_parts
- else
- parse_body
- end
+ mail.multipart? ? parse_parts : parse_body
end
def match?(query)
subject&.match(query) || text&.match(query) || html&.match(query)
end
def destroy
- location = Mailpeek.configuration.location
-
- FileUtils.rm_rf("#{location}/#{id}")
+ FileUtils.rm_rf("#{Mailpeek.configuration.location}/#{id}")
end
def read
File.exist?(read_file_path)
end