Class: MailHandler::Receiving::Checker

Inherits:
Object
  • Object
show all
Defined in:
lib/mailhandler/receiving/base.rb

Overview

Email receiving checker main class.

Direct Known Subclasses

FolderChecker, IMAPChecker

Constant Summary collapse

AVAILABLE_SEARCH_OPTIONS =
%i[
  by_subject
  by_content
  since
  before
  by_recipient
  count
  archive
  fast_check
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeChecker

Returns a new instance of Checker.



14
15
16
17
18
# File 'lib/mailhandler/receiving/base.rb', line 14

def initialize
  @available_search_options = AVAILABLE_SEARCH_OPTIONS
  set_base_search_options
  reset_found_emails
end

Instance Attribute Details

#available_search_optionsObject

Returns the value of attribute available_search_options.



10
11
12
# File 'lib/mailhandler/receiving/base.rb', line 10

def available_search_options
  @available_search_options
end

#found_emailsObject

Returns the value of attribute found_emails.



10
11
12
# File 'lib/mailhandler/receiving/base.rb', line 10

def found_emails
  @found_emails
end

#search_optionsObject

Returns the value of attribute search_options.



10
11
12
# File 'lib/mailhandler/receiving/base.rb', line 10

def search_options
  @search_options
end

Instance Method Details

#find(_options) ⇒ Object



24
25
26
# File 'lib/mailhandler/receiving/base.rb', line 24

def find(_options)
  raise MailHandler::InterfaceError, 'Find interface not implemented.'
end

#reset_found_emailsObject



32
33
34
# File 'lib/mailhandler/receiving/base.rb', line 32

def reset_found_emails
  @found_emails = []
end

#search_resultObject



28
29
30
# File 'lib/mailhandler/receiving/base.rb', line 28

def search_result
  !found_emails.empty?
end

#startObject



20
# File 'lib/mailhandler/receiving/base.rb', line 20

def start; end

#stopObject



22
# File 'lib/mailhandler/receiving/base.rb', line 22

def stop; end