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



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

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



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

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

.textObject



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

def text; return Sisimai::Eb::ReAWAY; end

.trueObject



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

def true(*); return false; end