Class: Rounders::Matchers::Subject

Inherits:
Matcher
  • Object
show all
Defined in:
lib/rounders/matchers/subject.rb

Instance Attribute Summary collapse

Attributes inherited from Matcher

#matchers

Instance Method Summary collapse

Methods inherited from Matcher

build, inherited

Methods included from Plugins::Pluggable

included

Constructor Details

#initialize(pattern) ⇒ Subject

Returns a new instance of Subject.



6
7
8
# File 'lib/rounders/matchers/subject.rb', line 6

def initialize(pattern)
  @pattern = pattern
end

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



4
5
6
# File 'lib/rounders/matchers/subject.rb', line 4

def pattern
  @pattern
end

Instance Method Details

#match(mail) ⇒ Object



10
11
12
13
# File 'lib/rounders/matchers/subject.rb', line 10

def match(mail)
  return if mail.subject.nil?
  mail.subject.match(pattern)
end