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.



16
17
18
19
20
# File 'lib/mailhandler/receiving/base.rb', line 16

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.



12
13
14
# File 'lib/mailhandler/receiving/base.rb', line 12

def available_search_options
  @available_search_options
end

#found_emailsObject

Returns the value of attribute found_emails.



12
13
14
# File 'lib/mailhandler/receiving/base.rb', line 12

def found_emails
  @found_emails
end

#search_optionsObject

Returns the value of attribute search_options.



12
13
14
# File 'lib/mailhandler/receiving/base.rb', line 12

def search_options
  @search_options
end

Instance Method Details

#find(_options) ⇒ Object



26
27
28
# File 'lib/mailhandler/receiving/base.rb', line 26

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

#reset_found_emailsObject



34
35
36
# File 'lib/mailhandler/receiving/base.rb', line 34

def reset_found_emails
  @found_emails = []
end

#search_resultObject



30
31
32
# File 'lib/mailhandler/receiving/base.rb', line 30

def search_result
  !found_emails.empty?
end

#startObject



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

def start; end

#stopObject



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

def stop; end