Module: Sisimai::Reason::Vacation

Defined in:
lib/sisimai/reason/vacation.rb

Overview

Sisimai::Reason::Vacation is for only returning text and description. This class is called only from Sisimai.reason method.

Constant Summary collapse

Index =
[
  'i am away on vacation',
  'i am away until',
  'i am out of the office',
  'i will be traveling for work on',
].freeze

Class Method Summary collapse

Class Method Details

.descriptionObject



15
# File 'lib/sisimai/reason/vacation.rb', line 15

def description; return 'Email replied automatically due to a recipient is out of office'; end

.match(argv1) ⇒ Boolean

Try to match that the given text and regular expressions

Parameters:

  • argv1 (String)

    String to be matched with regular expressions

Returns:

  • (Boolean)

    false: Did not match, true: Matched



20
21
22
23
24
# File 'lib/sisimai/reason/vacation.rb', line 20

def match(argv1)
  return false if argv1.nil? || argv1.empty?
  return true  if Index.any? { |a| argv1.include?(a) }
  return false
end

.textObject



14
# File 'lib/sisimai/reason/vacation.rb', line 14

def text; return 'vacation'; end

.trueObject



26
# File 'lib/sisimai/reason/vacation.rb', line 26

def true(*); return false; end