class Postmark::InactiveRecipientError

Constants

PATTERNS

Attributes

recipients[R]

Public Class Methods

new(*args) click to toggle source
Calls superclass method Postmark::ApiInputError::new
# File lib/postmark/error.rb, line 92
def initialize(*args)
  super
  @recipients = parse_recipients || []
end
parse_recipients(message) click to toggle source
# File lib/postmark/error.rb, line 82
def self.parse_recipients(message)
  PATTERNS.each do |p|
    _, recipients = p.match(message).to_a
    next unless recipients
    return recipients.split(', ')
  end

  []
end

Private Instance Methods

parse_recipients() click to toggle source
# File lib/postmark/error.rb, line 99
def parse_recipients
  return unless parsed_body && !parsed_body.empty?

  self.class.parse_recipients(parsed_body['Message'])
end