class Rounders::Matchers::From

Attributes

pattern[R]

Public Class Methods

new(pattern) click to toggle source
# File lib/rounders/matchers/from.rb, line 6
def initialize(pattern)
  @pattern = pattern
end

Public Instance Methods

match(message) click to toggle source
# File lib/rounders/matchers/from.rb, line 10
def match(message)
  return if message.from.nil?
  matches = message.from.map do |address|
    address.match(pattern)
  end
  matches.compact
end